做为反向代理的Nginx服务器配置如下
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | server { listen 80; server_name xiaohost.com www.xiaohost.com; if ($uri ~ [A-Z]){ rewrite ^(.*)$ $url last; } charset utf-8; proxy_set_header Host $http_host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; location / { proxy_pass http://192.168.1.2:80; } } |
最终被访问的服务器的内网IP为192.168.1.2端口80
原文链接:https://xiaohost.com/883.html,转载请注明出处。
评论3