Re: error page ?

Sergey Shepelev temotor gmail.com
27 16:56:59 MSD 2010


2010/4/27 -=HaRius=- <rh at nobrend.ru>:
> ...
>
> server {
> ...
> location / {
> ...
> proxy_intercept_errors off; # ,  on - 404  nginx' 
> error_page 404 =200 /404; # firebug    404
> ...
> }
> }
>

   location = /404.

   ,   404  , nginx    
  /404     200 ?

   ,        404 
  ?       
?

> 27  2010 . 15:49  Igor Sysoev <igor at sysoev.ru> :
>>
>> On Tue, Apr 27, 2010 at 06:29:27AM -0400, harius wrote:
>>
>> >          200 
>> >   .
>> >   ,     :
>> >
>> > error_page  404 =200 /404; # /404 -     
>> >  200
>> >
>> >   :
>> >
>> > limit_zone  myzone $binary_remote_addr 10m;
>> > proxy_cache_path /home/xxx/domains/xxx/cache/proxy levels=1:2
>> > keys_zone=static:250m;
>> > proxy_cache_path /home/xxx/domains/xxxx/cache/maps/jams levels=2:2
>> > keys_zone=jams:250m inactive=15m;
>> >
>> > server {
>> >   listen xxx:80;
>> >   server_name xxx;
>> >
>> >   limit_conn  myzone 10;
>> >
>> >   access_log /var/log/nginx/domains/xxx.log combined;
>> >
>> >   charset utf-8;
>> >
>> >   set $tile_root /home/xxx/domains/xxx/cache/maps/tiles;
>> >   set $proxied_uri http://xxx;
>> >   set $xmlrpc_proxied_uri http://xxx/points;
>> >   set $editpoints_proxied_uri http://xxx/poimanager;
>> >
>> >   location ~* .*\/map\/navitms.fcgi$ {
>> >     set $fcgi_uri $uri;
>> >
>> >     if ($args ~*
>> > "^t=([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2}),([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2}),([0-9]{2})$")
>> > {
>> >       set $tile_path $1/$5/$2/$6/$3/$7/$4/$8/$9.png;
>> >       rewrite ^.*$ /map/tiles/$tile_path last;
>> >       }
>> >     if ($args ~* "^(j=[0-9]{8},[0-9]{8},[0-9]{2})(,[0-9]+)?$") {
>> >       set $args $1;
>> >       rewrite ^.*$ /map/jams/ last;
>> >       }
>> >
>> >     return 404;
>> >     }
>> >
>> >   location ~ (.*/img/poi/).*\.gif$ {
>> >     root /home/xxx/domains/xxx/html;
>> >     try_files $uri $1/1.gif =404;
>> >     }
>> >
>> >   location /navitel/theme/navitel {
>> >     root /home/xxx/domains/xxx/html/map;
>> >     }
>> >
>> >   location /map {
>> >     index manage.html;
>> >     root /home/xxx/domains/xxx/html;
>> >     }
>> >
>> >   location /map/points {
>> >     proxy_cache off;
>> >     proxy_pass $xmlrpc_proxied_uri?$args;
>> >     }
>> >
>> >   location /map/poimanager {
>> >     proxy_cache off;
>> >     proxy_pass $editpoints_proxied_uri?$args;
>> >     }
>> >
>> >   location @proxy_tiles {
>> >     proxy_pass    $proxied_uri$request_uri;
>> >     proxy_store_access  user:rw group:rw;
>> >     proxy_store    $tile_root/$tile_path;
>> >     }
>> >
>> >   location ^~ /map/tiles/ {
>> >     internal;
>> >     alias $tile_root/;
>> >     if_modified_since before;
>> >     try_files $uri @proxy_tiles;
>> >     }
>> >
>> >   location = /map/jams/ {
>> >     internal;
>> >     proxy_cache_valid 200 302 5m;
>> >     proxy_cache    jams;
>> >     proxy_pass    $proxied_uri$fcgi_uri?$args;
>> >     }
>> >
>> >   location / {
>> >     proxy_pass http://localhost:8080;
>> >     proxy_redirect off;
>> >     proxy_set_header Host $host;
>> >     proxy_set_header X-Real-IP $remote_addr;
>> >     proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
>> >     client_max_body_size 500m;
>> >     # error_page  404 = /404; #    404 
>>
>>
>> http://sysoev.ru/nginx/docs/http/ngx_http_proxy_module.html#proxy_intercept_errors
>>
>>
>> --
>>  
>> http://sysoev.ru
>>
>> _______________________________________________
>> nginx-ru mailing list
>> nginx-ru at nginx.org
>> http://nginx.org/mailman/listinfo/nginx-ru
>
>
> _______________________________________________
> nginx-ru mailing list
> nginx-ru at nginx.org
> http://nginx.org/mailman/listinfo/nginx-ru
>
>


nginx-ru