New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
nginx name based virtual hosts issue
2 domains, 2 configs, 1 IP. Requests for domain2 end up loading/redirecting to domain1. Why?
/etc/nginx/sites-available/domain1.com:
/etc/nginx/sites-available/domain2.com
There are links to both configs for domain1.com and domain2.com in /etc/nginx/sites-enabled/
Comments
I think you miss the listen (with ip) on the non SSL part
listen XXX.XXX.XXX.XXX:80;
I tried that, same issue. Thank you for taking a look.
and missing:
why you do redirect to first domain?
Do you have some plugin like ssl anywhere (in your browser)? Because the 2nd site only listens on port 80 and then it will open the next vhost which listens on port 443, which is site1 in your case.
Had this issue yesterday, and while 90% of the time I remove the ip before the port[xx.x.x.x.:80] in my config file, I fixed it by actually adding the ip to the file.
To enforce no www per the client's request.
Aahh that might be it. Will test again later tonight. I do have HTTPS Everywhere installed.