nginx反向代理局域网访问外网

.配置内网hosts

 

 vim /etc/hosts

添加

host1(能连外网的服务器ip)   central.maven.org

 

 

2.在host1 服务器上nginx配置



     server {
           listen       80;
           server_name central.maven.org;
          location / {
           proxy_pass  http://central.maven.org;
           }
     }

 

posted @ 2018-06-08 10:01  zenghansen  阅读(13911)  评论(0编辑  收藏  举报