<div dir="ltr"><p style="margin:0px 0px 1em;padding:0px;border:0px;font-family:Arial,'Helvetica Neue',Helvetica,sans-serif;font-size:15px;line-height:inherit;vertical-align:baseline;clear:both;color:rgb(36,39,41)">We have a NGINX reverse proxy (clustered) with 45 upstreams (22 domains, 20 subdomains, 11 apps). </p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-family:Arial,'Helvetica Neue',Helvetica,sans-serif;font-size:15px;line-height:inherit;vertical-align:baseline;clear:both;color:rgb(36,39,41)">Some of our projects hosts apis for some users globally.</p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-family:Arial,'Helvetica Neue',Helvetica,sans-serif;font-size:15px;line-height:inherit;vertical-align:baseline;clear:both;color:rgb(36,39,41)">Our developers designed special custom 500 responses for special cases and want to show that messages only for tomcat_api upstream. </p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-family:Arial,'Helvetica Neue',Helvetica,sans-serif;font-size:15px;line-height:inherit;vertical-align:baseline;clear:both;color:rgb(36,39,41)">They want to serve 500 pages and handle exceptions on tomcat_api upstream members not on NGINX. But we want to handle all other 5xx errors on NGINX.</p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-family:Arial,'Helvetica Neue',Helvetica,sans-serif;font-size:15px;line-height:inherit;vertical-align:baseline;clear:both;color:rgb(36,39,41)">As I can not succeeded need a hand right now. </p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-family:Arial,'Helvetica Neue',Helvetica,sans-serif;font-size:15px;line-height:inherit;vertical-align:baseline;clear:both;color:rgb(36,39,41)">Here is the server configuration follows, could you please help?</p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-family:Arial,'Helvetica Neue',Helvetica,sans-serif;font-size:15px;line-height:inherit;vertical-align:baseline;clear:both;color:rgb(36,39,41)">Thank you.</p><pre style="margin-top:0px;margin-bottom:1em;padding:5px;border:0px;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,sans-serif;font-size:13px;line-height:inherit;vertical-align:baseline;width:auto;max-height:600px;overflow:auto;background-color:rgb(239,240,241);word-wrap:normal;color:rgb(36,39,41)">server { 
  server_name <a href="http://api.hotcoldwarm.com">api.hotcoldwarm.com</a>;

  location / {
    add_header X-Frame-Options SAMEORIGIN;
    add_header X-Content-Type-Options nosniff;
    add_header X-XSS-Protection "1; mode=block";
    add_header x-redirect-uri hotcoldwarm;
    add_header Strict-Transport-Security "max-age=31536000; includeSubdomains; always";
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_pass <a href="http://tomcat_api">http://tomcat_api</a>;
    proxy_next_upstream error timeout http_502 http_503 http_504 http_404;
    proxy_connect_timeout   1;
  }
    listen 80;
    listen 443 ssl;
    ssl_certificate /etc/rapidssl/live/<a href="http://api.hotcoldwarm.com/fullchain.pem">api.hotcoldwarm.com/fullchain.pem</a>;
    ssl_certificate_key /etc/rapidssl/live/<a href="http://api.hotcoldwarm.com/privkey.pem">api.hotcoldwarm.com/privkey.pem</a>;
    include /etc/rapidssl/options-ssl-nginx.conf;
    if ($scheme != "https") {
        return 301 https://$host$request_uri;
    }

}</pre>
</div>