Nginx反向代理删除端口号

时间:2017-05-26 07:51:52

标签: nginx networking proxy reverse-proxy nginx-location

需要Windows服务器设置来映射端口域

abc.com:8145 to abc.com server {listen 8145; server_name abc.com;}

需要服务器和位置配置来反向代理它

任何人都可以提供重定向网站的工作示例

1 个答案:

答案 0 :(得分:1)

server {
    listen 80;
    server_name abc.com
    location / {
        proxy_pass http://127.0.0.1:8145;   // the IP is your server ip.
        proxy_set_header Host $host;  //abc.com
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }

}