Welcome! Log In Create A New Profile

Advanced

PHP + Basic Auth for directories

Posted by Ben. 
PHP + Basic Auth for directories
October 25, 2010 05:25PM
Hi,

I have PHP running via FastCGI (PHP-FPM) which works fine. I am using the follwing location-directive:

[code]
location ~ \.php$ {

}
[/code]

Now I want to protect one folder (and the whole content) via Basic Authentication. The problem is if I put a location directive before the PHP-directive the included PHP-files are not handled. Other way round the protection is not working.

I found out that
a) nested locations are not recommended (bugs?)
b) I can put the PHP-directive twices (before and after the Basic Auth directive) which works but is ugly.

Is there a solution to this now? Some better way to solve this?

Thanks for help!
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 96
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready