Domain showing "Welcome to nginx"

Discussion in 'General' started by emilnygaard, Aug 7, 2013.

  1. emilnygaard

    emilnygaard New Member

    Hi,

    I just set up a complete ISPConfig 3 enviroment on my VPS and it seems to be working great - except for one thing:
    I added a new site called emilnygaard.dk in ISPConfig and pointed my domain (my nameserver is elsewhere) to the IP of the server running ISPConfig and the website. But when I go to http://emilnygaard.dk i get the nginx welcome site instead of the ISPConfig standard webpage for a client. Can anyone tell me what I'm doing wrong? :)
     
  2. almere

    almere Member HowtoForge Supporter

    Hello,

    DNS records are OK, are you sure, that the site is at the same IP as the DNS record A points to ?

    Is the site actually created ? ( /etc/nginx/sites-available/emilnygaard.dk.vhost exists? )
     
  3. emilnygaard

    emilnygaard New Member

    Oh right almere! Thanks! I found the host file and an .err vhost file.
    It says that the original vhost file has a syntax error... but the vhosts file is generated by ISPConfig, so I don't really get why it would have syntax errors?
     
  4. almere

    almere Member HowtoForge Supporter

    Can you post here your vhost.err?
     
  5. emilnygaard

    emilnygaard New Member

    Sure :)

    Code:
    server {
            listen *:80;
    
    
            server_name emilnygaard.dk www.emilnygaard.dk;
    
            root   /var/www/emilnygaard.dk/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/emilnygaard.dk/error.log;
            access_log /var/log/ispconfig/httpd/emilnygaard.dk/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/web2/web/stats/.htpasswd_stats;
            }
    
            location ^~ /awstats-icon {
                alias /usr/share/awstats/icon;
            }
    
            location ~ \.php$ {
                try_files /499bdb62ec5e3705e52570bb3a04f570.htm @php;
            }
    
            location @php {
                try_files $uri =404;
                include /etc/nginx/fastcgi_params;
                fastcgi_pass 127.0.0.1:9011;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                #fastcgi_param PATH_INFO $fastcgi_script_name;
                fastcgi_intercept_errors on;
            }
    
    
    
    
    
    }
    
     
  6. almere

    almere Member HowtoForge Supporter

    Ehm... What errors do you have in your nginx error log while restarting nginx with error vhost ?
     
  7. emilnygaard

    emilnygaard New Member

    I feel incredibly stupid for not reading that error message and trying to google it before! It was the server_names_hash_bucket_size that had to be increased to 64...
    Thank you so much for you kind help almere! :D
     
  8. silverboy65

    silverboy65 New Member

    hi
    i have the same problem
    there is my silverboy.ir.vhost.err

    Code:
    server {
            listen *:80;
    
    
            server_name silverboy.ir www.silverboy.ir;
    
            root   /var/www/silverboy.ir/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/silverboy.ir/error.log;
            access_log /var/log/ispconfig/httpd/silverboy.ir/access.log combined;
    
            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/client0/web2/web/stats/.htpasswd_stats;
            }
    
            location ^~ /awstats-icon {
    
    
    
    /var/log/nginx/error.log
    and
    /var/log/ispconfig/httpd/silverboy.ir/error.log
    are empty
     
  9. till

    till Super Moderator Staff Member ISPConfig Developer

    A .err file means that the nginx configuration was rejected by nginx, ispconfig stres it then as .err file so you can investigate the problem.

    Rename the file:

    silverboy.ir.vhost

    to

    silverboy.ir.vhost.bak

    and then silverboy.ir.vhost.err to silverboy.ir.vhost

    then try to restart nginx and check the error mesages that you get during restart on the shell and in the nginx log.
     
  10. silverboy65

    silverboy65 New Member

    thanks for reply

    i do this 2 rename and after restarting the domain works curreclty ,
    what is the problem ? i have to do this for each domains , how i can fix this ?
     
  11. till

    till Super Moderator Staff Member ISPConfig Developer

    Nginx did not restart at the time the website was edited, thats why ispconfig saved it as .err file. It might be that the restart was prevented e.g. by a fault of a manually edited config file in ngínx as ispconfig cant diagnose that, it has to assume that the issue is in the current changed vhost.

    If you have more .err files and the global nginx configuration is fine again, then you can use the resync tool to write out all site configs again.
     
  12. PermaNoob

    PermaNoob Member

    Love that resync tool !
     

Share This Page