Welcome! Log In Create A New Profile

Advanced

Second domain config does not redirect www traffic

February 19, 2015 01:59AM
Hello, I have ngnix installed to serve up to websites. The first one is behind is behind SSL and should redirect everything to https://EXAMPLE1.com. 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: http://pastie.org/private/ziromp4jqkbxehk5xjiha

Does conf loading order matter? These are the files as they appear in the nginx conf directory:
sites-enabled/EXAMPLE1.conf
sites-enabled/EXAMPLE2.conf

Could this be a DNS issue?
www.EXAMPLE1.com, www.example2.com, example1.com, example2.com 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 - http://www.EXAMPLE1.com redirects to https://EXAMPLE1.com
WORKS - http://EXAMPLE1.com redirects to https://EXAMPLE1.com
WORKS - https://EXAMPLE1.com

WORKS - http://EXAMPLE2.com
BROKE - http://www.EXAMPLE2.com fails to redirect to http://EXAMPLE2.com. I get a welcome to nginx screen.

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

Second domain config does not redirect www traffic

macmichael01 February 19, 2015 01:59AM

Re: Second domain config does not redirect www traffic

Francis Daly February 19, 2015 03:06AM

Re: Second domain config does not redirect www traffic

macmichael01 February 19, 2015 03:48AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 287
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready