Anonymous Coward magasesti at
Tue Feb 20 15:39:19 MSK 2007


im trying to deny access to everything that it's a dir/vhost using the
following config

        server {
                server_name     mysub.domain.tld;

                access_log      /var/log/nginx/localhost.access_log main;
                error_log       /var/log/nginx/localhost.error_log;

                root /var/www/localhost/htdocs/mysub.domain.tld;
        location / {
                deny all;
        location /nginx_status {
                stub_status on;
                access_log   off;
                deny all;
        location ~ .php$ {
                include /etc/nginx/fastcgi_params;
                fastcgi_index  index.php;

            # where the php files to pass to the listener.
                fastcgi_param  SCRIPT_FILENAME

Now there are 2 problems
- it only denies access to http://mysub.domain.tld/  if i connect from
another host
- if i connect from the right host when i try to access
http://mysub.domain.tld/ it wants me to download or open a file... if i try
http://mysub.domain.tld/index.php it works ok... same with
http://mysub.domain.tld/myadmin for example still wants me to download/open
file but works with http://mysub.domain.tld/myadmin/index.php

i tried with location ~ .* also but i get the same result except that it
correctly denies access to everything apparently... but i still can't see
the site from an allowed ip

What im doing wrong?

location ~ .*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the nginx mailing list