Scenario: Set up nginx reverse proxy in a third party, the server is remote, and the third party opens port 8800
When accessing xx.xx.xx.xx:8800, a 302 redirect appears, followed by a 400 address. The address is xx.xx.xx.xx and the 8800 port is lost (that is, it is redirected to the default port 80)
If you manually add port 8800, you can access it normally
Attached configuration
server {
listen 8800;
server_name localhost xxxxx;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
proxy_pass xxxxx;
proxy_set_header Host $host:8800;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header REMOTE-HOST $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
listen 8800;
No obvious problems are seen in the configuration, nginx will not actively redirect requests to port 80