5

nginx 301 redirect does not work for www. subdomain

view full story
linux-howto

http://serverfault.com – I am attempting to create a 301 re-direct from one domain to another with nginx. Here is what I'm currently doing and it works as I want: server { listen 80; server_name domain.net; return 301 $scheme://www.domain.net$request_uri; } server { listen 80; server_name www.domain.net; ... } I'd like to modify the first server block to include a .co domain to also re-direct to www.domain.net: server { listen 80; server_name domain.net domain.co www.domain.co; return 301 $scheme (HowTos)