Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > Installation/Configuration

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 14th September 2012, 09:23
meth meth is offline
Junior Member
 
Join Date: Jun 2008
Posts: 21
Thanks: 1
Thanked 0 Times in 0 Posts
Default [Nginx] Subdomain automatically loads another domain

I have ISPConfig 3.0.4.6 and Ningx installed in my server, I have created a subdomain in a domain A but this subdomains loads the webpage in domain B, I have try to find why, but I couldn't find any answer, here you have the two vhosts:
Code:
server {
        listen 91.121.163.140:80;
		
        
        server_name a.mthweb.org ;

        root   /var/www/a.mthweb.org/web;
		
		
		
        index index.html index.htm index.php index.cgi index.pl index.xhtml;
		

		
        error_page 400 /error/400.html;
        error_page 401 /error/401.html;
        error_page 403 /error/403.html;
        error_page 404 /error/404.html;
        error_page 405 /error/405.html;
        error_page 500 /error/500.html;
        error_page 502 /error/502.html;
        error_page 503 /error/503.html;
        recursive_error_pages on;
        location = /error/400.html {
            internal;
        }
        location = /error/401.html {
            internal;
        }
        location = /error/403.html {
            internal;
        }
        location = /error/404.html {
            internal;
        }
        location = /error/405.html {
            internal;
        }
        location = /error/500.html {
            internal;
        }
        location = /error/502.html {
            internal;
        }
        location = /error/503.html {
            internal;
        }
		
        error_log /var/log/ispconfig/httpd/a.mthweb.org/error.log;
        access_log /var/log/ispconfig/httpd/a.mthweb.org/access.log combined;

        ## Disable .htaccess and other hidden files
        location ~ /\. {
            deny all;
            access_log off;
            log_not_found off;
        }
		
        location = /favicon.ico {
            log_not_found off;
            access_log off;
        }

        location = /robots.txt {
            allow all;
            log_not_found off;
            access_log off;
        }
		
        location /stats {
            index index.html index.php;
            auth_basic "Members Only";
            auth_basic_user_file /var/www/clients/client1/web10/.htpasswd_stats;
        }

        location ^~ /awstats-icon {
            alias /usr/share/awstats/icon;
        }

        location ~ \.php$ {
            deny all;
        }

}
Code:
server {
        listen 91.121.163.140:80;
		
        
        server_name hiphop-producciones.net *.hiphop-producciones.net *.hiphop-producciones.org hiphop-producciones.org;

        root   /var/www/hiphop-producciones.net/web;
		
		
		
        index index.html index.htm index.php index.cgi index.pl index.xhtml;
		

		
        error_page 400 /error/400.html;
        error_page 401 /error/401.html;
        error_page 403 /error/403.html;
        error_page 404 /error/404.html;
        error_page 405 /error/405.html;
        error_page 500 /error/500.html;
        error_page 502 /error/502.html;
        error_page 503 /error/503.html;
        recursive_error_pages on;
        location = /error/400.html {
            internal;
        }
        location = /error/401.html {
            internal;
        }
        location = /error/403.html {
            internal;
        }
        location = /error/404.html {
            internal;
        }
        location = /error/405.html {
            internal;
        }
        location = /error/500.html {
            internal;
        }
        location = /error/502.html {
            internal;
        }
        location = /error/503.html {
            internal;
        }
		
        error_log /var/log/ispconfig/httpd/hiphop-producciones.net/error.log;
        access_log /var/log/ispconfig/httpd/hiphop-producciones.net/access.log combined;

        ## Disable .htaccess and other hidden files
        location ~ /\. {
            deny all;
            access_log off;
            log_not_found off;
        }
		
        location = /favicon.ico {
            log_not_found off;
            access_log off;
        }

        location = /robots.txt {
            allow all;
            log_not_found off;
            access_log off;
        }
		
        location /stats {
            index index.html index.php;
            auth_basic "Members Only";
            auth_basic_user_file /var/www/clients/client1/web4/.htpasswd_stats;
        }

        location ^~ /awstats-icon {
            alias /usr/share/awstats/icon;
        }

        location ~ \.php$ {
            try_files $uri =404;
            include /etc/nginx/fastcgi_params;
            fastcgi_pass 127.0.0.1:9013;
            fastcgi_index index.php;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            fastcgi_param PATH_INFO $fastcgi_script_name;
            fastcgi_intercept_errors on;
        }
		
        location /cgi-bin/ {
            try_files $uri =404;
            include /etc/nginx/fastcgi_params;
            root /var/www/clients/client1/web4;
            gzip off;
            fastcgi_pass  unix:/var/run/fcgiwrap.socket;
            fastcgi_index index.cgi;
            fastcgi_param SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            fastcgi_intercept_errors on;
        }
 	
}
As you can check first vhost loads the second vhost, but they have nothing in common, except the IP, but it is the server IP.

Note: Two domains belong to the same client, other clients don't happen.

Last edited by meth; 14th September 2012 at 16:41.
Reply With Quote
Sponsored Links
 

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Subdomain as domain & dns things sumfvm Installation/Configuration 6 24th March 2012 22:00
subdomain of ispc 3 as site main domain until added later 51b0rg Feature Requests 1 27th February 2012 09:44
Postfix queue problem? murunix Server Operation 7 2nd May 2011 01:55
subdomain vs Top domain anares Installation/Configuration 14 12th May 2010 21:00
email issue for second domain configured ISPConfig3 mscomputing Installation/Configuration 1 10th November 2009 10:09


All times are GMT +2. The time now is 14:18.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.