I am proxying some paths to another server. That server responds with 302 Moved Temporarily. I need to change that particular status code to 200 OK. Otherwise I can pass response through as-is and other status codes should pass without changes.

location /api {
  proxy_pass http://some.server/api;

Reason for status code mangling is IE that wont work with 302 status code in this request when using Ajax.

  • But 200 should give some result content, I guess. How should nginx get it? – Alexey Ten Jan 29 '15 at 12:42
  • 200 with empty content or fixed content (specified in nginx configuration) or 204 No Content are also suitable responses in my case. – Juha Syrjälä Jan 29 '15 at 18:21
  • Well, then you need error_page and proxy_intercept_errors – Alexey Ten Jan 29 '15 at 18:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.