MM Burn
MM Burn

Reputation: 11

Nginx set up global error_pages

i have a web nginx server (server1) in balancing mode - engaged in balancing requests to other web server - server2, server3, etc.. Sometimes the connection between them is cut off and the user receives a 504 error. the challenge is to show your 504 error page on server1, and that it is immediately applied to all virtual hosts. trying to make it so:

in http {

error_page 504 = static/504.html;

or

error_page 504 = /tmp/static/504.html;

but its not working, my custom page not showing.

how to customize the output of local errors for all virtual hosts without having to edit each config?

ps. im put in http { proxy_intercept_errors off, but no result

Upvotes: 1

Views: 2060

Answers (1)

Jing
Jing

Reputation: 78

My nginx is set like this, I think your format might be incorrect:

# Rails error pages
error_page 500 502 503 504 /500.html;
location = /500.html {
    root /srv/www/public;
}

Upvotes: 2

Related Questions