Welcome! Log In Create A New Profile

Advanced

Server 1 redirects, Server 2 does not

August 20, 2015 10:35PM
This problem may have been around before I updated to nginx version 1.9.4 but I'm not sure.

I have one VPS with two IP addresses. Server 1 redirects port 80 www and non-www to port 443 requests along with www requests on port 443 to the non-www web site. iow, http://(www.)site1.com/ and https://www.site1.com/ properly get 301 redirected to https:site1.com/

Site 2 does not do this and only redirects http:// requests to the equivalent https:// even though both server directives contain identical directives though different ssl certs.

server {
listen xxx.xxx.21.234:80;
server_name www.site1.com site1.com;
return 301 https://site1.com$request_uri;
}

server {
listen xxx.xxx.21.234:443 ssl http2;
server_name site1.com;

http2_keepalive_timeout 64;
keepalive_timeout 64;
...

This is identical for server 2 including the rest of the directives in the server block. My one question is whether the ssl cert for server2 may not be properly set up for the www name but I'm not sure.

Does something immediately jump out as the problem or where should I look further? Other than the redirection, everything on server2 works as it should.
Subject Author Posted

Server 1 redirects, Server 2 does not

drhowarddrfine August 20, 2015 10:35PM

Re: Server 1 redirects, Server 2 does not

drhowarddrfine August 20, 2015 10:37PM

Re: Server 1 redirects, Server 2 does not

drhowarddrfine August 20, 2015 11:09PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 255
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