Results 1 to 15 of 15

Thread: Nginx Error

  1. #1

    Nginx Error

    I installed Nginx on our VPS(Virtuozzo + 512MB RAM) running cPanel+Apache+suphp, the installation give an error in start and I rolled back to older python version (3.09) from 3.10 and this time nginx installed successfully.

    But now when I try to start/restart it, it generates following warnings
    nginx: [warn] conflicting server name "XXX.XXX.XXX.XXX" on XXX.XXX.XXX.XXX:80, ignored
    nginx: [warn] conflicting server name "XXX.XXX.XXX.XXX" on XXX.XXX.XXX.XXX:80, ignored
    nginx: [warn] conflicting server name "XXX.XXX.XXX.XXX" on XXX.XXX.XXX.XXX:80, ignored
    nginx: [warn] conflicting server name "XXX.XXX.XXX.XXX" on XXX.XXX.XXX.XXX:80, ignored

    I have 2 IPs on the VPS and on the 2nd IP I am running a dedicated prestashop with SSL. and in all the above errors its generating the error for the 2nd IP.

    Any help will be great. I can contact my provider to assist, but in that case there will be no learning, so please help me out.

  2. #2
    Join Date
    Jul 2007
    Location
    Ashburn, VA
    Posts
    1,314
    Don't worry about it. We're getting those warnings with dedicated IPs also. Not a big deal.
    Preetam Jinka

    Isomerous - High performance web services for business and individuals.
    Bitcable Colocation, KVMs, cPanel hosting, Oracle expertise, and more.

  3. #3
    Join Date
    Jun 2011
    Location
    Brugge
    Posts
    159
    Check that you don't have the same site listen on the same port + Ip under server entry set listen default to 80 and add domains+ip.

    Would be helpfull if you could post your nginx.conf and include your other config files located in Conf.d or Vhost depending on how you set it up.


    I would think you have two entry listening to the same ip + port.

    Its really easy to solve, but with this information it could be a thousands lines..

  4. #4
    I did some testing and reach at the following conclusion,
    If a domain hosted on a dedicated IP has a sub-domain, hosted on the same IP, nginx will generate the above warning for each sub-domain. I deleted all the sub-domains are restarted the nginx and there was no warning. I added 1 sub-domain and there was 1 warning.

    @ptimo3, ok, getting the details.

  5. #5
    Join Date
    Jun 2011
    Location
    Brugge
    Posts
    159
    Quote Originally Posted by bryankewl View Post
    I did some testing and reach at the following conclusion,
    If a domain hosted on a dedicated IP has a sub-domain, hosted on the same IP, nginx will generate the above warning for each sub-domain. I deleted all the sub-domains are restarted the nginx and there was no warning. I added 1 sub-domain and there was 1 warning.

    @ptimo3, ok, getting the details.

    Strange shouldn't be getting a warning, i have a similar config, where i configure my main domain, then i add several subdomains, and don't receive any warnings, i'll see to attach a sameple in a sec

  6. #6
    Join Date
    Jun 2011
    Location
    Brugge
    Posts
    159
    example server entry from subdomein
    server {
    listen 80 default;
    server_name your.subdomein.com; ##

    root /home/admin;

    And in your main nginx you don't realy need to specify the listen port.
    As per default you do this in your Conf.d dir / vhost ..

    Depends on how your setup is.

  7. #7
    Join Date
    Jun 2011
    Location
    Brugge
    Posts
    159
    Quote Originally Posted by ptimo3 View Post
    example server entry from subdomein
    server {
    listen 80 default;
    server_name your.subdomein.com; ##

    root /home/admin;

    And in your main nginx you don't realy need to specify the listen port.
    As per default you do this in your Conf.d dir / vhost ..

    Depends on how your setup is.
    And this is a main nginx.conf sample to include conf.d conf files:

    user admin;
    worker_processes 4;
    error_log /var/log/nginx/error.log;
    pid /var/run/nginx.pid;

    events {
    worker_connections 1024;
    }

    http {
    include /etc/nginx/mime.types;
    default_type application/octet-stream;

    log_format main '$remote_addr - $remote_user [$time_local] "$request "'
    '$status $body_bytes_sent "$http_referer" '
    '"$http_user_agent" "$http_x_forwarded_for"';
    access_log /var/log/nginx/access.log main;

    sendfile on;
    autoindex off;
    map $scheme $fastcgi_https { ## Detect when HTTPS is used
    default off;
    https on;
    }

    keepalive_timeout 10;

    gzip on;
    gzip_comp_level 2;
    gzip_proxied any;

    tcp_nopush on;
    tcp_nodelay on;
    gzip_static on;
    gzip_vary on;
    gzip_min_length 512;
    gzip_buffers 256 8k;

    gzip_types text/plain text/html text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript;

    # Load config files from the /etc/nginx/conf.d directory
    include /etc/nginx/conf.d/*.conf;

    }

  8. #8
    /etc/nginx/nginx.conf
    user nobody;
    # no need for more workers in the proxy mode
    worker_processes 2;
    error_log /var/log/nginx/error.log info;
    worker_rlimit_nofile 20480;
    events {
    worker_connections 5120; # increase for busier servers
    use epoll; # you should use epoll here for Linux kernels 2.6.x
    }
    http {
    server_name_in_redirect off;
    server_names_hash_max_size 10240;
    server_names_hash_bucket_size 1024;
    include mime.types;
    default_type application/octet-stream;
    server_tokens off;
    sendfile on;
    tcp_nopush on;
    tcp_nodelay on;
    keepalive_timeout 5;
    gzip on;
    gzip_vary on;
    gzip_disable "MSIE [1-6]\.";
    gzip_proxied any;
    gzip_http_version 1.1;
    gzip_min_length 1000;
    gzip_comp_level 6;
    gzip_buffers 16 8k;
    # You can remove image/png image/x-icon image/gif image/jpeg if you have slow CPU
    gzip_types text/plain text/xml text/css application/x-javascript application/xml image/png image/x-icon image/gif image/jpeg application/xml+rss text/javascript application/atom+xml;
    ignore_invalid_headers on;
    client_header_timeout 3m;
    client_body_timeout 3m;
    send_timeout 3m;
    reset_timedout_connection on;
    connection_pool_size 256;
    client_header_buffer_size 256k;
    large_client_header_buffers 4 256k;
    client_max_body_size 200M;
    client_body_buffer_size 128k;
    request_pool_size 32k;
    output_buffers 4 32k;
    postpone_output 1460;
    proxy_temp_path /tmp/nginx_proxy/;
    client_body_in_file_only on;
    log_format bytes_log "$msec $bytes_sent .";
    include "/etc/nginx/vhosts/*";
    }
    /etc/nginx/vhosts/site-with-dedicated-ip.com
    server {
    error_log /var/log/nginx/vhost-error_log warn;
    listen XXX.XXX.XXX.XXX:80;
    server_name site-with-dedicated-ip.com www.site-with-dedicated-ip.com XXX.XXX.XXX.XXX;
    access_log /usr/local/apache/domlogs/site-with-dedicated-ip.com-bytes_log bytes_log;
    access_log /usr/local/apache/domlogs/site-with-dedicated-ip.com combined;
    root /home/USER/public_html;
    location / {
    location ~.*\.(3gp|gif|jpg|jpeg|png|ico|wmv|avi|asf|asx|mpg|mpeg|mp4|pls|mp3|mid|wav|swf|flv|html|htm|txt|js|css|exe|zip|tar|rar|gz|tgz|bz2|uha|7z|doc|docx|xls |xlsx|pdf|iso)$ {
    expires 7d;
    try_files $uri @backend;
    }
    error_page 405 = @backend;
    add_header X-Cache "HIT from Backend";
    proxy_pass http://XXX.XXX.XXX.XXX:8081;
    include proxy.inc;
    }
    location @backend {
    internal;
    proxy_pass http://XXX.XXX.XXX.XXX:8081;
    include proxy.inc;
    }
    location ~ .*\.(php|jsp|cgi|pl|py)?$ {
    proxy_pass http://XXX.XXX.XXX.XXX:8081;
    include proxy.inc;
    }
    location ~ /\.ht {
    deny all;
    }
    }
    if you can advise some tweaks and improvements that will be great. I installed the nginx using the script by nginxcp.com

    PS: I am newbie to VPS and managing servers.

  9. #9
    Join Date
    Jun 2011
    Location
    Brugge
    Posts
    159
    If you remove the ip from this line warning should dissapear

    server_name site-with-dedicated-ip.com www.site-with-dedicated-ip.com XXX.XXX.XXX.XXX;

    As you already specified ip on the top line :-)

    Tips, Depends on what your running :-)

    I switched to nginx to play with magento ..
    And then instead of proxying the php to apache i use php-fpm.

    Seem to perform a bit faster :-)

  10. #10
    thanks ptimo3. it worked.

    I am using the VPS for general hosting and testing.

    It has wordpress, prestashop running. I am also going to install node.js.

  11. #11
    Join Date
    Jun 2011
    Location
    Brugge
    Posts
    159
    Quote Originally Posted by bryankewl View Post
    thanks ptimo3. it worked.

    I am using the VPS for general hosting and testing.

    It has wordpress, prestashop running. I am also going to install node.js.
    Your welcome, have fun playing with nginx
    I know i'm :-)

  12. #12
    is there any vhost template nginx use? so I can change it to not include IPs in the vhosts to make sure such warnings never appear again.

    Also if I add/change some config directly in nginx configs, will nginx keep them or overwrite them once I add/edit some config from cpanel for apache etc?

  13. #13
    Join Date
    Jun 2011
    Location
    Brugge
    Posts
    159
    just remove the ip from the line and leave

    listen 80;


    this wil bind to all adresses on port 80

  14. #14

    Check to see if there's a backup config file

    I know it's a late reply. But here's what I found in my case:

    I was editing an nginx config file (one of those extra .conf files that are "included"), and the system had created a backup file - which probably also got "included". I deleted the backup file, restarted nginx, and the error message went away.

    Hope this helps someone.

  15. #15
    Join Date
    Jul 2009
    Location
    Zafra, Spain
    Posts
    32
    cd /etc/nginx/vhosts
    perl -pi -w -e 's/server_name(.*) IP here/server_name$1/g;' *
    /etc/init.d/httpd restart

Similar Threads

  1. nginx upstream timed out error
    By heropage in forum Hosting Security and Technology
    Replies: 14
    Last Post: 11-30-2012, 06:39 PM
  2. Nginx 504 error
    By jamiedolan in forum Web Hosting
    Replies: 0
    Last Post: 03-16-2011, 09:54 PM
  3. Weird SSL error with Nginx
    By geekinfinance in forum VPS Hosting
    Replies: 6
    Last Post: 03-07-2011, 01:42 PM
  4. Nginx error: Address in use
    By ASKTH in forum VPS Hosting
    Replies: 8
    Last Post: 12-28-2010, 11:56 PM
  5. An error when starting Nginx
    By Showfom in forum Hosting Software and Control Panels
    Replies: 0
    Last Post: 11-18-2010, 08:37 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •