Proxy error handling

Roxis roxis at list.ru
Thu Feb 28 16:57:28 MSK 2008


On Thursday 28 February 2008, Igor Shergin wrote:
> server {
>
>         listen 80;
>         server_name proxytest;
>         access_log "/var/log/nginx/proxytest_log";
>         error_log "/var/log/nginx/proxytest_error";
>
>         location / {
>             proxy_intercept_errors on;
>             proxy_pass http://backend;
>             error_page 404 = @nopic;
>         }
>
>         location @nopic {
>            root /home/proxytest;

-            rewrite ^/test3(.*)$     /3.jpg;
-            rewrite ^/test2(.*)$     /2.jpg;
-            rewrite ^/test1(.*)$     /1.jpg;
+           rewrite ^/test3(.*)$     /3.jpg break;
+           rewrite ^/test2(.*)$     /2.jpg break;
+           rewrite ^/test1(.*)$     /1.jpg break;

>            return 200;
>         }
>
> }





More information about the nginx-ru mailing list