this post was submitted on 09 Aug 2024
1 points (100.0% liked)

nginx

4 readers
1 users here now

The nginx community on Reddit. Reddit gives you the best of the internet in one place.

founded 1 year ago
MODERATORS
 
The original post: /r/nginx by /u/Kaleodis on 2024-08-08 21:12:41.

Hi everyone, I hope someone could help me with a small snippet.

I currently have nginx set up as a reverse proxy for a bunch of services - which sometimes go down. When these are down, nginx displays a generic 502 error page.

I would like to redirect the user to a custom status page (hosted at status.mydomain.tld) if the service is down (and thus would generate a 502). I have found the error_page directive (and the @ location thingy), although I'm unsure on how to use it.

I currently have a file for every subdomain (with a server {} block in it for port 443 (and 80 redirecting to it)) and would like to not repeat too much - if possible i'd like to set the redirect stuff exactly once.

Anyone has any experience doing this?

no comments (yet)
sorted by: hot top controversial new old
there doesn't seem to be anything here