• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Reversed Proxy Linux

LoOoZa

Member
Joined
Sep 18, 2017
Messages
68
Reaction score
6
I have Linux host 32 GB of ram and I want to create reversed proxy to send the login to my main host so people can connect with my Linux proxy ip and gets redirected to my main host.
 
Solution
Assuming Ubuntu 16.04:

Install nginx:
$ sudo apt-get -y install nginx
Open nginx config file:
$ sudo vim /etc/nginx/nginx.conf
(Or open that file with a program like WinScp)

With vim:
Use the down arrow on your keyboard until you reach the last line.
Press the letter "i" on your keyboard to switch to insert mode.
Type in the following, replacing 123.456.78.9 with the IP of your actual game server and replacing 7172 with whatever port your gameserver runs on (if you haven't changed anything it'll be 7172)
Code:
stream {
  server {
    listen 7172;
    proxy_pass 123.456.78.9:7172;
  }
}
Press the Esc key to switch out of insert mode.
Press the colon key ( shift+; on an american keyboard layout) to switch to command mode (you'll see a...
Have you tried googling how to do it?

That's by the way exactly what @platano did to find what he told you.

Here this will help you:

It is a very simple thing but we can't help you on every step if you have no idea how to handle your system.
Can't tell you every single letter you have to write. Just find a tutorial on how to do it, and find it yourself instead of asking others to find it for you.
 
i already installing it , i don't have commands this site no give me command to do this edit

Lua:
location /some/path/ {
    proxy_pass http://www.example.com/link/;
}
 
Assuming Ubuntu 16.04:

Install nginx:
$ sudo apt-get -y install nginx
Open nginx config file:
$ sudo vim /etc/nginx/nginx.conf
(Or open that file with a program like WinScp)

With vim:
Use the down arrow on your keyboard until you reach the last line.
Press the letter "i" on your keyboard to switch to insert mode.
Type in the following, replacing 123.456.78.9 with the IP of your actual game server and replacing 7172 with whatever port your gameserver runs on (if you haven't changed anything it'll be 7172)
Code:
stream {
  server {
    listen 7172;
    proxy_pass 123.456.78.9:7172;
  }
}
Press the Esc key to switch out of insert mode.
Press the colon key ( shift+; on an american keyboard layout) to switch to command mode (you'll see a colon : appear in the bottom left of your screen)
Type "wq" without the quotation marks and press enter, this will save the file and exit.

Restart nginx:
$ sudo /etc/init.d/nginx restart

All done
 
Solution
Do I need to touch "proxy_buffer_size 16k;" If I am getting many connections?
Because it seems like server is laggingg, when its 40+ online
How to redirect player with his main ip? Because every player logs in the server with proxy's ip instead of his ip
 
Reading the docs AS I SAID will GET YOU REALLY FAR on your goals...


This is fucking problem with you new people, expecting to get solved everything just because you lack of research skills.


When buffering is enabled, nginx receives a response from the proxied server as soon as possible, saving it into the buffers set by the proxy_buffer_size and proxy_buffers directives. If the whole response does not fit into memory, a part of it can be saved to a temporary file on the disk.

When buffering is disabled, the response is passed to a client synchronously, immediately as it is received. …



So, what does all of that mean?

  1. First of all, Nginx is highly optimised to be the most efficient with the resources at stake. It's well known for using the least amount of resources to service each individual connection. An extra 4KB increase per connection would be quite an increase — that's how efficient it is.
  2. You may notice that the size of the buffer is chosen to be equivalent to page size of the platform at stake. Page (computer memory) - Wikipedia (https://en.wikipedia.org/wiki/Page_(computer_memory)) Basically, long story short, the absolute best number might as well go beyond the scope of this question on StackOverflow, and may as well be highly dependent on operating system and CPU architecture.
  3. Realistically, the difference between a bigger number of smaller buffers, or a smaller number of bigger buffers, may depend on the memory allocator provided by the operating system, as well as how much memory you have, and how much memory you want to be wasted by being allocated without being used for a good purpose.
    E.g., I would not set it to proxy_buffers 1 1024k, because then you'll be allocating a 1MB buffer for every buffered connection, even if the content could still easily fit in a 4KB one, potentially wasting extra memory (although, of course, there's also the little-known fact that unused-but-allocated-memory is virtually free since 1980s). There's likely a good reason that the default number of buffers have been chosen to be 8 as well.
  4. Increasing the buffers at all might actually be a bit pointless if you actually do caching of the responses of these binary files with Module ngx_http_proxy_module (http://nginx.org/r/proxy_cache), because nginx will still be writing it to disc for caching, and you might as well not waste the extra memory for buffering these responses.
    A good operating system should be capable of already doing appropriate caching of the stuff that gets written to disc through the file-system buffer-cache functionality — see https://www.tldp.org/LDP/sag/html/buffer-cache.html (and possibly the somewhat strangely-named article at Page cache - Wikipedia (https://en.wikipedia.org/wiki/Page_cache), as "disk-buffer" name was already taken for the HDD hardware article) — so, there's likely little need to duplicate buffering directly within nginx. You might also take a look at varnish-cache for some additional ideas and inspiration about the subject of multi-level caching, and the fact that good operating systems are already supposed to take good care of many things that some folks still nonetheless try to mistakenly optimise through application-specific functionality.
  5. Likewise, if you don't actually do the caching of the responses, then you might as well ask yourself whether or not buffering is or is not appropriate in the first place.
    Realistically, buffering may come useful to better protect your upstreams from the slowloris attack vector — Slowloris (computer security) - Wikipedia (https://en.wikipedia.org/wiki/Slowloris_(computer_security)) — however, if you do let your nginx have megabyte-sized buffers, then, essentially, you're starting to expose nginx itself for consuming an unreasonable amount of resources to service clients with malicious intents.
  6. If the responses are too large, you might want to look into optimising it at the response level. Doing splitting of some content into individual files; doing compression on the file level; doing compression with gzip on HTTP Content-Encoding level etc.
TL;DR: this is really a pretty broad question, and there are too many variables that require non-trivial investigation to come up with the absolute best answer for any given situation.
1592578680254.png

Try it


source
 
Last edited:
You fell from the skies.
Hello, I'm behind a CG-NAT, so I've been trying to accomplish this:

Fedora Open VPN Server on my parent's house which Ports 7171 and 7172 are forwarded correctly
my pc where I want to host connects as a client to the vpn
Then I tried to send traffic via ssh tunnel to my open vpn client IP : 10.8.0.2 but I cant login

I'm gonna try this method :p
 
Back
Top