Nginx 1.7.0: location @php

support no-reply at alllangin.com
Mon Jun 2 06:31:22 UTC 2014


yes.

update and test

02.06.2014 10:24, wishmaster пишет:
>   I have the same problem in my php-application. Admin folder is protected with auth_basic and the rest folders - without auth. I have not found any solution except code duplication for php location.
>   
>
>   --- Original message ---
>   From: "TECK" <nginx-forum at nginx.us>
>   Date: 2 June 2014, 06:47:47
>    
>
>
>> Francis,
>>
>> We are going in circles without reaching a solution. I think what I asked is
>> very clear and simple:
>> How do I avoid repeating a segment of configuration code assigned to @php
>> into various locations:
>> location @php {
>> try_files $uri =404;
>> fastcgi_split_path_info ^(.+\.php)(/.+)$;
>> fastcgi_pass fastcgi;
>> fastcgi_param PATH_INFO $fastcgi_path_info;
>> fastcgi_param PATH_TRANSLATED $document_root$fastcgi_script_name;
>> include fastcgi.conf;
>> }
>>
>> The above configuration will never change, regardless in what location is
>> used:
>> location ^~ /alpha {
>> auth_basic "Restricted Access";
>> auth_basic_user_file htpasswd;
>> try_files $uri $uri/ /alpha/index.php?$uri
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>



More information about the nginx mailing list