logo
down
shadow

Have custom Nginx error page when All backend servers unhealty


Have custom Nginx error page when All backend servers unhealty

By : user2954194
Date : November 22 2020, 01:01 AM
hope this fix your issue You can use proxy_next_upstream [1] to specify case when the request be passed to the next backend, e.g. 502 error, etc. When the backend is unavailable, or all of them are unvailable when using proxy_next_upstream, a 502 error will be returned. You can specify which file is served in this situation.
code :
location / {
        proxy_pass http://backend;
        error_page 502 /50x.html;
    }
location /50x.html {
    }


Share : facebook icon twitter icon
How to create custom error 502 nginx in core of nginx (not using redirect to error page)?

How to create custom error 502 nginx in core of nginx (not using redirect to error page)?


By : matiasm15
Date : March 29 2020, 07:55 AM
To fix the issue you can do I found an answer that works for me. In the vhost config file, I put right at the end of the server block, before closing brace:
code :
 error_page 502 /502.html;
 location = /502.html {

      root  /home/xaluano/public_html;

  }
<head>
<meta http-equiv="refresh" content="40" /> 
</head>
<body>
<script language="JavaScript" type="text/javascript">
/*<![CDATA[*/
var TimerVal = 40;
var TimerSPan = document.getElementById("CDTimer");
function CountDown(){
   setTimeout( "CountDown()", 1000 );
   TimerSPan.innerHTML=TimerVal;
   TimerVal=TimerVal-1;
   if (TimerVal<0) { TimerVal=0;
   location.reload(true); 
//   window.location.href = "http://www.xaluan.com";
   } //improvement by vivalibre, tq 
}
CountDown();
/*]]>*/ </script> 
</body>
nginx not use custom error page in one location

nginx not use custom error page in one location


By : Iván
Date : March 29 2020, 07:55 AM
I hope this helps you . Yes it is, for your location just set your custom error pages again but leave them out which you want not handled by nginx.
How can I setup a custom 503 error page in NGINX?

How can I setup a custom 503 error page in NGINX?


By : Edmar Alvin Parro
Date : March 29 2020, 07:55 AM
it should still fix some issue The below configuration works for close to the latest stable nginx 1.2.4. I could not find a way to enable a maintenance page with out using an if but apparently according to IfIsEvil it is an ok if.
To enable maintenance touch /srv/sites/blah/public/maintenance.enable. You can rm the file to disable. Error 502 will be mapped to 503 which is what most people want. You don't want to give Google a 502. Custom 502 and 503 pages. Your app will generate the other error pages.
Nginx won't use custom 502 error page

Nginx won't use custom 502 error page


By : saurabh
Date : March 29 2020, 07:55 AM
Hope this helps Found the solution after some experimenting. I think the error came from the "error_page" 404 statements, and I didn't think try_files was so powerful. Anyway, that's the final configuration that works, as it can be useful to some people :
nginx custom error page for all requests

nginx custom error page for all requests


By : Jack Brach
Date : March 29 2020, 07:55 AM
it should still fix some issue i try to provide a custom 404 for all requests in a vhost, Tried: , like @Richard Smith commented:
shadow
Privacy Policy - Terms - Contact Us © ourworld-yourmove.org