2014-06-30 37 views
0

重定向我運行一個Rails應用程序與標準500.html消息,並在我的nginx.conf我:nginx的error_page不與基本設置

server { 
    listen 80 default; 
    root ~/Projects/rails/localstyling; 
    try_files $uri/index.html $uri @unicorn; 

    location @unicorn { 
     proxy_pass http://localhost:3000; 
     error_page 500 502 503 504 /500.html; 
    } 

    error_page 500 502 503 504 /500.html; 
} 

我曾嘗試加入proxy_intercept_message;略高於error_page部分,但它不工作。我無法讓nginx停止提供自己的500個錯誤頁面。

+0

我不能讓你有什麼想 –

+0

我希望它服務器/500.html在我的Rails應用程序的根文件夾,而是nginx的正顯示出了自己的500錯誤頁面。 – JonleePeakman

+0

你的'root'指令不正確。你應該使用絕對路徑。 –

回答

0
server { 
    listen 80 default; 
    root <HOME DIRECTORY>/Projects/rails/localstyling; 
    try_files $uri/index.html $uri @unicorn; 

    location @unicorn { 
     proxy_pass http://localhost:3000; 
     error_page 500 502 503 504 /500.html; 
    } 

    error_page 500 502 503 504 /500.html; 
}