nginx returns html instead of json response

Sergey A. Osokin osa at freebsd.org.ru
Wed Nov 16 21:40:20 UTC 2022


On Wed, Nov 16, 2022 at 10:29:04PM +0530, Kaushal Shriyan wrote:
> Checking in again if someone can help me with my earlier post to this
> mailing list? Thanks in advance.

I'd recommend to take a look on the proxy_intercept_errors directive [1],
it helps to intercept 300+ error codes and processing with the error_page
directive [2].

References
1. https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_intercept_errors
2. http://nginx.org/en/docs/http/ngx_http_core_module.html#error_page

Hope that helps.

-- 
Sergey A. Osokin



More information about the nginx mailing list