Nginx-ru mailing list archive (nginx-ru@sysoev.ru)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: image_filter+proxy_pass and 301 (moved permanently) on backend
Отвечу сам себе. Верный конфиг следующий:
proxy_intercept_errors on;
location ~* "^/photos/(.*)$" {
error_page 301 302 307 =200 @redir;
#любой ДНС
resolver 8.8.8.8
image_filter resize 50 -;
proxy_pass http://$1;
proxy_redirect off;
}
location @redir {
resolver 8.8.8.8
set $newh $upstream_http_location;
image_filter resize 50 -;
proxy_pass $newh;
}
Причем, строка "set $newh $upstream_http_location;" необходима. Если сразу
написать
proxy_pass $upstream_http_location;
то, почему-то, не работает.
Posted at Nginx Forum:
http://forum.nginx.org/read.php?21,245867,245948#msg-245948
_______________________________________________
nginx-ru mailing list
nginx-ru@xxxxxxxxx
http://mailman.nginx.org/mailman/listinfo/nginx-ru
|