nginx跳转访问

 server {
        listen       8888;
        server_name  localhost;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location / {
            root   html;
            index  index.html index.htm index.jsp;
            proxy_pass http://xx.xx.xx.xx:xxxx;
            proxy_set_header           Host $host;
            proxy_set_header           X-Real-IP $remote_addr;
            proxy_set_header           X-Forwarded-For $proxy_add_x_forwarded_for;       
        }

在局域网中网段隔离 ,需网段1访问网段2网站,此时需要把nginx架设到一台有内外网的中间机上,通过修改nginx.conf文件(nginx下conf文件夹中)能实现网段1访问中间服务器实现对网段2的跳转访问。

猜你喜欢

转载自www.cnblogs.com/wangpeili/p/10425670.html
今日推荐