How do you configure NGINX so that it handles 50x errors from upstream server B that upstream server A cannot? -


i have started learning nginx , encountered problems. still getting , error 500, if have configured nginx (1.4.6) error_page directive. config works ( woops.html expected ) if try not send error 500 second upstream server. here's configuration file:

server {     listen 80 default_server;      root /srv/www;     index index.html index.htm;     server_name test.dev;      location / {             proxy_pass http://localhost:8080;             proxy_intercept_errors on;             error_page 500 @retry;     }      location @retry {             proxy_pass http://localhost:8081;             proxy_intercept_errors on;             error_page 500 /woops.html;     }      location = /woops.html {             root /srv/www;     } }  server {     listen 8080;     listen localhost:8080;     server_name localhost;     root /srv/www;      location / {             return 500;     } }   server {     listen 8081;     listen localhost:8081;     server_name localhost;     root /srv/www/app;      location / {             return 500;     }  } 


Comments

Popular posts from this blog

Ansible - ERROR! the field 'hosts' is required but was not set -

customize file_field button ruby on rails -

SoapUI on windows 10 - high DPI/4K scaling issue -