↧
Answer by Linztm for nginx 302 redirect only naked IP
You would need to have a single server block as both will not be read while they match the same listen directive.You should be able to modify the blocks as follows to acheive your desired...
View ArticleAnswer by Jacob Evans for nginx 302 redirect only naked IP
Put it in quotes and now it's as expected.server { listen 198.251.86.133:80; server_name "198.251.86.133"; return 302 http://www.jacobdevans.com/anycast-301/;}server { listen 198.251.86.133:80...
View Articlenginx 302 redirect only naked IP
I'm trying to setup a 302 redirect if someone enters the IP address, but 301 all other requests to the www.subdomain of that domain.server { listen 198.251.86.133:80; server_name 198.251.86.133; return...
View Article