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 have a domain that includes a dash, e.g. the-domain.com, when I made a server block with a server name of my domain and restarted nginx, I got a warning:

Restarting nginx: nginx: [warn] server name "/var/www/domain.com/www/thedomain" has strange symbols in /etc/nginx/sites-enabled/domain.com:56 nginx.

So I changed the domain to another one I have, it still continues to say the same error from above. I don't understand why it's saying this when I change it to an appropiate one?

This the repeated error:

Restarting nginx: nginx: [warn] server name "/var/www/domain.com/www/domaindir" has strange symbols in /etc/nginx/sites-enabled/domain.com:56 nginx.

My configuration file for the domain is shown below:

server {

    server_name     domain.com;

    root            /var/www/domain.com/www;
    index           index.php index.htm index.html;
    error_page      404 /404.html;
    error_page      500 502 503 504  /50x.html;

    access_log      /var/www/domain.com/logs/access.log;
    error_log       /var/www/domain.com/logs/errors.log;

    error_page 404  /index.php;

    location ~ \.php$ 
    {
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME /var/www/domain.com/www$fastcgi_script_name;
        include fastcgi_params;
    }
}

server {

    server_name     ~^(.+)\.domain\.com$;

    set             $file_path $1;

    root            /var/www/domain.com/www/$file_path;
    index           index.php index.htm index.html;
    error_page      404 /404.html;
    error_page      500 502 503 504  /50x.html;

    access_log      /var/www/domain.com/logs/access.log;
    error_log       /var/www/domain.com/logs/errors.log;

    location /
    {
        try_files $uri /$uri /index.php?$args;
    }

    location ~ \.php$ 
    {
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME /var/www/domain.com/www$fastcgi_script_name;
        include fastcgi_params;
    }
}

server {

    server_name     anotherdomain.org

    root            /var/www/domain.com/www/domaindir;  # this is line 56
    index           index.php index.htm index.html;
    error_page      404 /404.html;
    error_page      500 502 503 504  /50x.html;

    access_log      /var/www/domain.com/logs/access.log;
    error_log       /var/www/domain.com/logs/errors.log;


    location ~ \.php$ 
    {
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME /var/www/domain.com/www$fastcgi_script_name;
        include fastcgi_params;
    }
}

What seems to be the problem making this error thrown?

share|improve this question

1 Answer 1

up vote 14 down vote accepted

Easy: missing ";" after server_name at line 54.

share|improve this answer
    
OH! HAHAHAHA! I blame my tiredness! Thanks! –  MacMac Jan 7 '12 at 3:27

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.