cw_
cw_

Reputation: 21

Nginx reverse proxy returning 404 when server is down

I'm reverse proxying all traffic for a subdomain to a local server.

Using the following directive works great when the proxied server is up.

location / {
    proxy_pass  http://localhost:8900;
}

When localhost:8900 is down, nginx returns a 404. Is there a way to return a 502 or equivalent?

Upvotes: 1

Views: 274

Answers (1)

cw_
cw_

Reputation: 21

Turns out when I migrated my nginx.confs to a new server, the error page locations changed and nginx couldn't find the error page thus serving a 404.

Upvotes: 1

Related Questions