Hello,
I am using the auth_basic directive to restrict access to a whole server
(auth_basic server-wide set, not in any particular location).
Since I am using php, I am also using:
location ~ \.php$ {
FastCGI stuff here...
}
to forward my request to the PHP application.
Now, I would like to remove the auth_basic authentication for a very unique
and specific location: thisfile.php
I first tried:
location ~ \.php$ {
location = /thisfile.php {
auth_basic off;
}
FastCGI stuff here...
}
but Nginx said:
nginx: [emerg] location "/thisfile.php" is outside location "\.php$" in
..../nginx/conf.d/mystupid.conf:69
nginx: configuration file .../nginx/nginx.conf test failed
I then tried:
location ~ \.php$ {
location ~ ^/thisfile.php$ {
auth_basic off;
}
FastCGI stuff here...
}
But of course now the FastCGI part does not server the request and the PHP
file is sent for download...
What king of clean solution do I have?
Am I forced to place the auth_basic in all my 'location' blocks but one,
which would be for 'thisfile.php'?
Thanks,
---
*B. R.*
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx