Quantcast
Channel: nginx 302 redirect only naked IP - Server Fault
Browsing latest articles
Browse All 3 View Live

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 Article


Answer 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 Article


nginx 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
Browsing latest articles
Browse All 3 View Live