Redirect http:8080 to https:8443

ST smntov at gmail.com
Mon Jun 5 12:28:09 UTC 2017


Hello,

I try to redirect http on port 8080 to https on port 8443 as follows,
but it doesn't seem to work. http redirects to https, but the port
remains the same - 8080. Why?

Thank you!

# redirect http to https
server {
    listen 8080;
    server_name n.example.com;
    return 301 https://$host:8443/$request_uri;
}

server {
        listen   8443 ssl;
	server_name n.example.com;
...
}



More information about the nginx mailing list