Reinis Rozitis
August 12, 2017 09:00AM
> Here, whenever I enter www.armapedia.de in my browser, I am redirected to
> armapedia.3jgkp.de. I dont understand this behavior at all. All examples about
> nginx and multiple vhosts with different domains just use the appropriate
> server_name entries, so I'm really stuck here.

First - I would try to upgrade nginx / you are using quite an old (~3 years) version 1.6.2.

I don't particularly remember at what point but there have been some issues/changes on how nginx handles virtual server priority. At least I've seen a similar issue in serving wrong SSL certificates (as in chosing the wrong virtual server block / SNI not working as expected) which went away after upgrade to a most recent version.

While it may not be the case here it's a good point to start for a better support.



Looking at the response headers for armapedia.de:

Connecting to www.armapedia.de (www.armapedia.de)|88.99.227.139|:80... connected.
HTTP request sent, awaiting response...
HTTP/1.1 301 Moved Permanently
Server: nginx/1.6.2
Date: Sat, 12 Aug 2017 12:48:45 GMT
Content-Type: text/html; charset=UTF-8
Connection: keep-alive
Set-Cookie: wsc30_cookieHash=3fffeb677df909960a434c5f05d66f2007cde491; path=/; domain=armapedia.3jgkp.de; HttpOnly
Location: http://armapedia.3jgkp.de/


There is a cookie for armapedia.3jgkp.de .. which means that the request is actually passed to php (also the redirect could come from php not nginx) which shouldn’t happen with:
return 301 https://www.armapedia.de$request_uri;

what again indicates that the request is handled by the first server {} block rather than the one you expect.

rr

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Two domains and multiple server blocks

Jamesadamar August 12, 2017 03:21AM

Re: Two domains and multiple server blocks

basti August 12, 2017 04:18AM

Re: Two domains and multiple server blocks

Jamesadamar August 12, 2017 05:08AM

RE: Two domains and multiple server blocks

Reinis Rozitis August 12, 2017 09:00AM

RE: Two domains and multiple server blocks

Iurii Medvedev August 12, 2017 09:04AM

RE: Two domains and multiple server blocks

Reinis Rozitis August 12, 2017 09:12AM

Re: Two domains and multiple server blocks

Iurii Medvedev August 12, 2017 09:18AM

RE: Two domains and multiple server blocks

Reinis Rozitis August 12, 2017 09:28AM

Re: RE: Two domains and multiple server blocks

Jamesadamar August 12, 2017 11:07AM

RE: RE: Two domains and multiple server blocks

Reinis Rozitis August 12, 2017 04:02PM

Re: RE: RE: Two domains and multiple server blocks

Jamesadamar August 12, 2017 04:09PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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