Ocultar a porta durante o proxy precisa dessas duas linhas no corpo do servidor:
server_name_in_redirect off;
proxy_set_header Host $host:$server_port;
O conf é como:
server
{
listen 80;
server_name example.com;
server_name_in_redirect off;
proxy_set_header Host $host:$server_port;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://localhost:8080;
}
access_log off;
}