2

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.

HopelessN00b
  • 53,795
  • 33
  • 135
  • 209
xperator
  • 457
  • 2
  • 12
  • 24
  • [Administration panels are off topic](http://serverfault.com/help/on-topic). [Even the presence of an administration panel on a system,](http://meta.serverfault.com/q/6538/118258) because they [take over the systems in strange and non-standard ways, making it difficult or even impossible for actual system administrators to manage the servers normally](http://meta.serverfault.com/a/3924/118258), and tend to indicate low-quality questions from *users* with insufficient knowledge for this site. – HopelessN00b Mar 08 '15 at 20:53

3 Answers3

2

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;
 }
kworr
  • 1,055
  • 8
  • 14
  • 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 : http://pastebin.com/n00BwZUa – xperator Jun 12 '12 at 20:54
  • But you have two *include* options. They insert content of named files (with globbing) to current file. Check files in /etc/nginx/conf.d/, I think first by alphabet should be your blog... – kworr Jun 12 '12 at 21:01
  • let us [continue this discussion in chat](http://chat.stackexchange.com/rooms/3751/discussion-between-kworr-and-xperator) – kworr Jun 12 '12 at 21:07
1

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

pjmorse
  • 1,550
  • 1
  • 17
  • 34
Ivan
  • 11
  • 1
0

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.

dyasny
  • 18,802
  • 6
  • 49
  • 64