Problem with a virtualhost

David mishy.cth at gmail.com
Sat Sep 6 18:32:24 MSD 2008


Hello,

I am able to access domain.org.uk but www.domain.org.uk 404s and defaults to the
nginx welcome page. It's behaving as if it cannot find a www.domain.org.uk match
so resorts to the default nginx page.

I can't see anything wrong with my conf. Any ideas ?

Thank you 



server {
        listen          192.168.30.12;
        server_name     domain.org.uk www.domain.org.uk;
        access_log      /var/log/nginx/domain.org.uk.access.log main;

        location / {
                index   index.php index.html index.htm;
                root    /home/user/public_html;
        }

        location ^~ / {
                auth_basic            "Authorization Required";
                auth_basic_user_file  /home/user/not_web_accessible/.htpasswd;
        }

        location ~ \.php$ {
                fastcgi_pass 127.0.0.1:9000;
                fastcgi_index index.php;
                fastcgi_intercept_errors  on;
                fastcgi_param  SCRIPT_FILENAME   
/home/user/public_html$fastcgi_script_name;
                include /usr/local/nginx/fastcgi_params;
        }

        # serve static files directly
        location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|html)$ {
            access_log        off;
            expires           2d;
        }

        # prevent access to .htaccess if still exist
        location ~ /\.ht {
                deny  all;
        }

}







More information about the nginx mailing list