Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

change the HTTP status code returned when proxy_pass gateway is down

$
0
0
Hi
we would like to change the HTTP status code to 200 whenever the backend ("http://example.com/auth") machine behind nginx goes down for some reason.
Is this possible via nginx?

location /files {
auth_request /auth;
set $auth_key $arg_key;
}

location /auth {
internal;
proxy_pass http://example.com/auth;
proxy_pass_request_body off;
proxy_set_header Content-Length "";
proxy_set_header X-Original-URI $request_uri;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Key $auth_key;
}

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>