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;
           }
     }

 

转载于:https://www.cnblogs.com/zenghansen/p/9154131.html

你可能感兴趣的:(运维)