I have an nginx set up in a very boring fashion as a reverse proxy to an appserver. But sometimes my upstream gets the environment variable SERVER_PORT, sometimes it does not. Anyone suggest why it's not consistent or how I might troubleshoot it?
upstream starman {
server unix:/var/run/starman.sock;
}
server {
<snip>
location / {
proxy_pass http://starman;
proxy_set_header SERVER_PORT $server_port;
}
It may be other location in your config, passing requests without adding SERVER_PORT.