Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am running Nginx/ISPConfig setup for about 6-7 months. Never had a problem and everything is smooth. But I just noticed that if browse to "blab.example.com", the page opens one of my wordpress blogs on the other domain.

No matter what name I use for subdomain, Anything that I enter randomly "b53ks.example.com" still goes to that blog page.

I have 3 or 4 different domain names and websites on the same server. But I think I misconfigured somewhere and that might be the cause of this.

Lets say I have these domains: example-1.com, example-2.com, another-example.com

If I go to anything.example-1.com or serverfault.example-2.com, or google.another-example.com the returned page is my blog at blog.example-1.com

Note : I didn't set any subdomain in ISPConfig. Instead, I used "Add new website" for making a subdomain.

share|improve this question

3 Answers 3

up vote 2 down vote accepted

There actually many possibilities:

  1. You can have your blog on the other address and all sites you mention are pointing to this address.
  2. You can have your blog configured with (you can check detailed listen description):

    listen 192.168.8.1:80 default_server;

This way you will end up in a server that will serve any unknown domain as your blog.

There are multiple choices on how to deal with that. Personally I prefer keeping simple sinkhole default virtual host for nginx that returns the contents of /var/empty:

server {
 listen *:80 default_server;
 root /var/empty;
}

You can also read about server_name nginx option on how to deal with domain wildcards. If you happen to prefer linking subdomains to your original sites you'd better do:

 server {
  server_name .example.com;
  return 301 http://example.com;
 }
share|improve this answer
    
I checked all vhost files, But I couldn't find any relation between domains and the blog domain. There is no default path set anywhere. Everything Seems ok on ISPConfig too. I am confused. In fact this problem was there since beginning. But in my older server, the default page was a domain and not a blog. Something should be wrong somewhere. –  xperator Jun 12 '12 at 19:04
    
What site appears first in your nginx configuration for this ip address? –  kworr Jun 12 '12 at 20:14
    
What you mean appears first ? –  xperator Jun 12 '12 at 20:31
    
First from the beginning of the nginx.conf file. In absense of dedicated default_server first one found is promoted to default_server. –  kworr Jun 12 '12 at 20:37
    
There is no such thing as default_server! Here is my nginx.conf : pastebin.com/n00BwZUa –  xperator Jun 12 '12 at 20:54

Be sure that in ispconfig, the option Auto-Subdomain is not set on *.. That could cause a similar case.

share|improve this answer

Today I had the exact same problem with Ispconfig 3 on Debian 7 with nginx server, and I have found the solution.

I have verified that this error occurs when you add one website and select for it a specified IP address when, at the same time, other websites are using the option of "all address" with the symbol * .

Therefore I have selected for all website the ip address to * and all works correctly.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.