How to get response body when using proxy_intercept_errors
des.davc12 at gmail.com
Tue Jul 14 16:12:31 UTC 2020
Stop emails to me
On Tue, Jul 14, 2020, 6:13 AM Maxim Dounin <mdounin at mdounin.ru> wrote:
> On Tue, Jul 14, 2020 at 04:25:46AM -0400, salmanpskply wrote:
> > I have a requirement where when proxied response error code is 401
> > (condition #1) and response body has text "SAML Token Expired" (condition
> > #2), I need to intercept it and redirect to refresh token API.
> > I could do it partially where only error code 401 is considered. Not
> able to
> > find a way to read response body text to give condition #2:
> There is no way. Errors are intercepted based on the response
> headers, and the response body is not read from the upstream
> server if the error is intercepted.
> If you need to analyze the response body, consider using njs
> instead. Doing appropriate subrequest and looking into it might
> work for you, see here for details:
> Maxim Dounin
> nginx mailing list
> nginx at nginx.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the nginx