Welcome! Log In Create A New Profile

Advanced

sub.example.com loads example.com when sub vhost config is not loaded

Posted by HittingSmoke 
sub.example.com loads example.com when sub vhost config is not loaded
October 08, 2013 01:05PM
I run three vhosts on my nginx 1.1.9 server. example.com sub1.example.com and sub2.example.com. Each one has the server name explicitly defined in it's vhost config file. There are no config entries for _ and nothing to fall back on. All domains that should be used are explicitly defined.

sub2 is only spun up when required for specific purposes. I have nginx configured in a Debian/buntu style config with sites-available and sites-enabled. When I remove the symlink in sites-enabled for sub2, sub2 loads the files from example.com and hence its database resources. The URL in the address bar retains the sub2 prefix. I tested this with sub1.example.com by removing the sites-enabled symlink and it behaves the same way, returning data that should only be available through example.com.

Why are my two subdomains even responding to requests when there is no vhost that matches a server name for them? There's nothing in my logs to suggest what's causing this.



Edited 1 time(s). Last edit at 10/08/2013 01:09PM by HittingSmoke.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 130
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready