Behavior of server depends on a file name

Gregor Jurgele gregor.jurgele at gmail.com
Fri Sep 12 12:59:47 MSD 2008


Hello

I would like to run a few virtual sites on one IP on nginx 0.6.32 compiled
from source as Debian package on Debian Etch.

My nginx.conf contents are:

user www-data;
worker_processes  1;

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;

    access_log  /var/log/nginx/access.log;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;
    tcp_nodelay        on;

    gzip  on;

    server_tokens     off;

    include /etc/nginx/conf.d/*.conf;
    include /etc/nginx/sites-enabled/*;
}

My virtual site file (www.bona-a.com) contents are:

server {
        listen   80;
        server_name  www.bona-a.com;

        access_log  /var/log/nginx/www.bona-a.com.access.log;

        location / {
                root   /var/www/www.bona-a.com;
                index  default.html default.htm index.html index.htm;
        }

        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        #
        #location ~ \.php$ {
                #fastcgi_pass   127.0.0.1:9000;
                #fastcgi_index  index.php;
                #fastcgi_param  SCRIPT_FILENAME
/scripts$fastcgi_script_name;
                #includefastcgi_params;
        #}
}

If I name a file or symbolic link in /etc/nginx/sites-enabled/, that holds
the information for a virtual site, www.bona-a.com, this site becomes a
catch-all site, answering all requests that go to the same ip and do not
match any of the sites defined in other files in /etc/nginx/sites-enabled/.

Same is if I replace -a with - followed by any letter between b and d
(including). If I name the file www.bona-e.com or www.bona.com, everything
works fine and i get 403 Forbidden as a reply.

What am I doing wrong?

Regards,

Gregor
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nginx.org/pipermail/nginx/attachments/20080912/ab2b8a6c/attachment.html>


More information about the nginx mailing list