SyntaxFix
Write A Post
Hire A Developer
Questions
nginx also provides the $http_host variable which will pass the port for you. its a concatenation of host and port.
So u just need to do:
proxy_set_header Host $http_host;