在配置文件ierp.conf里面,新增如下配置,将/ierpext/路径转发到/ierp,实现内网地址访问内网,外网地址访问外网
location ^~ /ierpext/ {
proxy_pass http://127.0.0.1:8022/ierp/; #转发到内网配置去
proxy_connect_timeout 1800;
proxy_read_timeout 1800;
proxy_send_timeout 1800;
proxy_set_header Host $host:$server_port;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-NginX-Proxy true;
proxy_set_header clientDomain http://192.168.210.16:8022/ierpext/;
alias /var/appstatic/static-files/cosmic/webapp/; #静态资源存放地址
}
推荐阅读