V
V
Valery Pankov2015-01-29 18:59:43
PHP
Valery Pankov, 2015-01-29 18:59:43

How to hide a site behind a proxy?

I have a server on it site, and there is also a vds server, how can I hide the site behind vds? that is, the vds server will serve as a proxy server.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Tutubalin, 2015-01-29
@laryk

I recently did it myself, the
first haproxy option is easy, the
second (I used it) is nginx proxying (this is done on vps)
server {
server_name site.ru www.site.ru;
listen vps_ip_address;
location / {
proxy_pass http:// IP_address_of the main server:81;
proxy_redirect http:// primary server_ip_address :81/ /;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
}
include /usr/local/ispmgr/etc/nginx.inc; #this is only if there is an ISPManager
}
the third option is just port forwarding through iptable

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question