I have a machine foo00
whos CNAME
is foo
. With nginx
I can access my site from the following URLs:
foo/
foo00/
foo.domain.local/
foo00.domain.local/
How can I configure nginx
so that all are redirected foo.domain.local
?
I tried the following:
server {
listen 80;
server_name foo.domain.local;
return 301 $scheme://$host$request_uri;
}
This redirects foo/
to foo.domain.local/
but not foo00/
or foo00.domain.local
. Any ideas?