Protect a specific php file

António P. P. Almeida appa at perusio.net
Thu Jan 12 16:52:34 UTC 2012


On 12 Jan 2012 16h21 WET, nginx-forum at nginx.us wrote:

> Hello, 
>
> Any idea why ? Any solution ?

Yes. Duplicate the FCGI setup in the /myapp/index.php location.

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

--- appa




More information about the nginx mailing list