Use Nginx reverse proxy function to solve the problem of port 80 being blocked on WEB website

  • 2020-05-06 12:06:11
  • OfStack

The network environment of the mainland, under the system of the celestial god and beast, let me wait for a small P people tragedy; At the drop of a wire, sealed the machine room; Now a more powerful move, from the gateway to block your 80 port, once blocked, the website domain name can not access;
Above then nonsense, the following into the topic, the other is not, directly to the code, the use of nginx reverse proxy function, generally we are very understand, also not much record;
[code]
server {
listen 80;
server_name a.jb51.net;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header REMOTE-HOST $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
access_log off;
location / {
proxy_pass http://192.168.1.100:81;
}
}

server {
listen 80;
server_name b.jb51.net;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header REMOTE-HOST $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
access_log off;
location / {
proxy_pass http://www.baidu.com:8080;
}
}
[html]

Related articles: