Protect a specific php file

voidandany nginx-forum at nginx.us
Fri Jan 13 08:57:09 UTC 2012


It was already duplicate like this :

location ^~ /myapp/index.php {
auth_basic "Private Section";
auth_basic_user_file $document_root/.htpasswd;
location ~ \.php$ {
include /etc/nginx/fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass 127.0.0.1:9000;
}
}

The inside location ~ \.php$ is silly because so I remove it like you
said, but no change.

By the way the problem is not when I use the complete url
(http://www.domain.fr/myapp/index.php) but when I don't add the
index.php page (http://www.domain.fr/myapp/)

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,221094,221150#msg-221150



More information about the nginx mailing list