X-Accel-Redirect 404 fallback

Nicholas Kostirya nick_ik at mail.ru
Tue Mar 19 05:07:43 UTC 2013


 .

  .

 location / {
  proxy_pass  http://0:5000;
 }

 location = /404 {
  root /tmp/nginx;
  error_page 404 /404.html;
  return 404;
 }

 location ~* \.(html)$ {
  root /tmp/nginx;
  error_page 404 /404.html;
 }

    "X-Accel-Redirect: /404".
/404     error_page 404   /404.html   404 HTTP .

   memcached:

 location / {
  set $memcached_key "test:$uri";
  memcached_pass unix:/tmp/memcached.sock;
  default_type text/html;
  error_page 404 = @fallback;
 }

 location @fallback {
  proxy_pass  http://0:5000;
 }

 location = /404 {
  root /tmp/nginx;
  error_page 404 /404.html;
  return 404;
 }

 location ~* \.(html)$ {
  root /tmp/nginx;
  error_page 404 /404.html;
 }

   ,      "X-Accel-Redirect: /404",
 nginx   /404.html ,   .

    "X-Accel-Redirect: /404.html",    404 .

     ?

,  memcached   ,      error_page.
 ,         ,      .



----------------------------------------------------------------------

----------------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx-ru/attachments/20130319/364aa852/attachment-0001.html>


nginx-ru