location + error_page + url prefixes
    Maxim Yemelyanov 
    maxim4d at gmail.com
       
    Sat Jan 31 02:36:27 MSK 2009
    
    
  
теперь при запросе несуществующего url с любым языком выдается
содержимое /500.html, причем если этот файл удалить, то выскакивает
сообщение
Status: 500 Internal Server Error Content-Type: text/html
Application error (Rails)
в пределах server-а никаких ссылок на 500.html нет
       location /ru/ {
           error_page   500 502 503 504  /500_ru.html;
           error_page   404           =  @mongrel_ru;
       }
       location @mongrel_ru {
          proxy_pass http://mongrel;
          proxy_intercept_errors   on;
          recursive_error_pages   on;
          error_page   404         /404_ru.html;
      }
вот секция location / :
    location / {
      if (-f $request_filename) {
        break;
      }
      if (-f $request_filename/index.html) {
        rewrite (.*) $1/index.html break;
      }
      if (-f $request_filename.html) {
        rewrite (.*) $1.html break;
      }
      if (!-f $request_filename) {
        proxy_pass http://mongrel;
        access_log  /home/abp/log/nginx.offside-mongrel.access.log
main buffer=100;
        break;
      }
    }
-- 
regards,
Maxim
    
    
More information about the nginx-ru
mailing list