Имею следуюзий конфиг:
map $http_user_agent $players {
default 1;
"~mplayer|vlc|nsplayer" 0;
}
server {
location /pl/ {
if ($players) {
return 444;
}
location ~ ^/pl/([0-9]+)$ {
proxy_pass http://127.0.0.1:4026/$1;
}
location ~ ^/pl/([0-9]+)$ {
proxy_pass http://127.0.0.1:4026/$1;
}
}
}
Если if ($players) { return 444; } расположен внутри location /pl/, то
он не срабатывает.
Если его вынести из location /pl/ - работает.
Вот пример рабочего конфига:
server {
if ($players) {
return 444;
}
location /pl/ {
location ~ ^/pl/([0-9]+)$ {
proxy_pass http://127.0.0.1:4026/$1;
}
location ~ ^/pl/([0-9]+)$ {
proxy_pass http://127.0.0.1:4026/$1;
}
}
}
Версия nginx-1.0.1.
_______________________________________________
nginx-ru mailing list
nginx-ru@nginx.org
http://nginx.org/mailman/listinfo/nginx-ru