Nginx-ru mailing list archive (nginx-ru@sysoev.ru)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
nginx location single php file
- To: nginx-ru@xxxxxxxxx
- Subject: nginx location single php file
- From: "skeletor" <nginx-forum@xxxxxxxx>
- Date: Thu, 16 May 2013 05:35:10 -0400
- Dkim-signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=helium.jlkhosting.com; s=x; h=Date:Sender:From:Message-ID:Content-Transfer-Encoding:Content-Type:Subject:To; bh=VUtc5bmZjAsGFq9nnZnr1ujUywDc/TW/h0OmWoSivtw=; b=0kpq5h1jXEOvrEH+Iyx1NBWTPPXpYcZw7an54JAvHZ6tq54cGf2Esa9Qavews8X9hDYFLP9mV6m7hR3G1P4upBpRyiTW76RjLHhe/jPG2GFXJRpJQ/IxQDF7gsLFHipK1SeqzX3yRUkdzpoTgASB7Kr0YYmFIrSJIcoOg3euAwQ=;
Всем привет.
Нужно отключить basic авторизацию для запроса
http://domain.com/rpc.php?jkfgsdkfg. Для всего сайта включена basic
авторизация. Создаю новый location :
location ~ /rpc.php {
auth_basic off;
fastcgi_pass 127.0.0.1:9000;
fastcgi_param DOCUMENT_ROOT /www;
fastcgi_param SCRIPT_FILENAME /www$fastcgi_script_name;
fastcgi_param PATH_TRANSLATED /www$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_PROTOCOL $server_protocol;
fastcgi_param GATEWAY_INTERFACE "CGI/1.1";
fastcgi_param SERVER_NAME $server_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param REMOTE_USER $remote_user;
fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param REMOTE_PORT $remote_port;
fastcgi_param GEOIP_COUNTRY_CODE $geoip_city_country_code;
fastcgi_param GEOIP_COUNTRY_NAME $geoip_city_country_name;
fastcgi_param GEOIP_REGION $geoip_region;
fastcgi_param GEOIP_CITY $geoip_city;
}
Но не работает (то есть, всё равно требуется авторизация). Хотя вот такие
location'ы вполне работают (то есть, при запросе
http://domain.com/ajax/jfsgf.php?fhfsl - basic авторизация не
запрашивается):
location /ajax {
auth_basic off;
alias /www/ajax;
}
location ~ /ajax/(.*\.php)$ {
auth_basic off;
fastcgi_pass 127.0.0.1:9000;
fastcgi_param DOCUMENT_ROOT /www;
fastcgi_param SCRIPT_FILENAME /www$fastcgi_script_name;
fastcgi_param PATH_TRANSLATED /www$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_PROTOCOL $server_protocol;
fastcgi_param GATEWAY_INTERFACE "CGI/1.1";
fastcgi_param SERVER_NAME $server_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param REMOTE_USER $remote_user;
fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param REMOTE_PORT $remote_port;
fastcgi_param GEOIP_COUNTRY_CODE $geoip_city_country_code;
fastcgi_param GEOIP_COUNTRY_NAME $geoip_city_country_name;
fastcgi_param GEOIP_REGION $geoip_region;
fastcgi_param GEOIP_CITY $geoip_city;
}
Не могу понять, почему запрашивается basic авторизация при запросе
http://domain.com/rpc.php и как её отключить.
Уже по разному пробовал location менять:
location = /rpc.php
location /rpc.php
не работает.
Posted at Nginx Forum:
http://forum.nginx.org/read.php?21,239256,239256#msg-239256
_______________________________________________
nginx-ru mailing list
nginx-ru@xxxxxxxxx
http://mailman.nginx.org/mailman/listinfo/nginx-ru
|