Nginx Reverse proxy to remove port number

房东的猫 提交于 2019-12-14 03:35:32

问题


Need windows server setting to map the port domain

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

Need server and location config to reverse proxy it

can anyone provide the working example of redirecting website


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

}


来源:https://stackoverflow.com/questions/44196395/nginx-reverse-proxy-to-remove-port-number

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!