51工具盒子

依楼听风雨
笑看云卷云舒,淡观潮起潮落

nginx 转发外部地址

需求:

访问A地址/ 都转发到 39.12.12.3:8082

访问A地址/v3 都转到: 10.0.0.3:8080

server {
        listen 80;
        server_name uat-b.a.com;
        location / {
            
            proxy_pass http://48.93.190.46:8422;
           # include proxy_params;
          
          proxy_set_header Host $host;
          proxy_set_header X-Real-Ip $remote_addr;
          proxy_set_header X-Forwarded-For $remote_addr;
          }

       location  /v3 {


            proxy_pass http://192.168.1.209:31003;
            include proxy_params;
}
}
赞(3)
未经允许不得转载:工具盒子 » nginx 转发外部地址