Problem with a virtualhost

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


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

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

Thank you 

server {
        access_log      /var/log/nginx/ 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_index index.php;
                fastcgi_intercept_errors  on;
                fastcgi_param  SCRIPT_FILENAME   
                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