Rewrite HTTP status code

Hello. I’m running nginx as a proxy for back-end servers that are
returning a non-standard HTTP status phrase. I’d like to be able to
rewrite the status to something standard. For
example, if the back-end returns:

HTTP/1.1 400 Not Understood

I’d like to rewrite to:

HTTP/1.1 400 Bad Request

Thanks.

Regards,
John

Hello!

On Fri, Mar 21, 2014 at 10:52:16PM +0000, John de Freitas wrote:

Hello. I’m running nginx as a proxy for back-end servers that are
returning a non-standard HTTP status phrase. I’d like to be able to
rewrite the status to something standard. For
example, if the back-end returns:

HTTP/1.1 400 Not Understood

I’d like to rewrite to:

HTTP/1.1 400 Bad Request

You may do so using proxy_intercept_errors, though it will rewrite
response body, too.

http://nginx.org/r/proxy_intercept_errors


Maxim D.
http://nginx.org/

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs