I have a domain that I can browse to via example.com:1234
. Now I do not want to always have to type the port at the very end, but rather have nginx redirect me to the static URL when browsing a subdomain eg. status.example.com
.
I have tried writing a redirect, but it didn't work at all.
server {
listen 80;
server_name status.example.com;
return 301 $scheme://www.example.com:1234;
}
Where's my error? Is it the server block? Am I missing something basic here?