nginx wildcard redirect suspicious symbols warnig
You won't match URIs in the server_name directive as it's ... for server names.
server {
listen 80;
server_name *.example.gr;
location /en {
return 301 http://www.example.gr/el/;
}
}
server {
listen 80;
server_name www.example.gr;
location /el {
# Your stuff
}
}
For the record, Nginx server name choosing order is :
- Exact name
- Longest name with a leading wildcard
- Longest name with a trailing wildcard
- First matching regular expression