Second domain config does not redirect www traffic

macmichael01 nginx-forum at
Thu Feb 19 06:59:03 UTC 2015

Hello, I have ngnix installed to serve up to websites. The first one is
behind is behind SSL and should redirect everything to
This works perfectly as for the second website, its only being hosted on
http. All www traffic should redirect to non-www but it fails.

Here is my nginx config:

Does conf loading order matter? These are the files as they appear in the
nginx conf directory:

Could this be a DNS issue?,,, all have A
Host name records defined. Should I use a Cname record for the www.* names

Here is what works and what fails:
WORKS - redirects to
WORKS - redirects to

BROKE - fails to redirect to I
get a welcome to nginx screen.

Any ideas? Thanks so much for any help that can be provided!

Posted at Nginx Forum:,256780,256780#msg-256780

More information about the nginx mailing list