Default answer at proxy timeout

B.R. reallfqq-nginx at yahoo.fr
Wed Nov 26 14:47:50 UTC 2014


n
​ginx provides​
​proxy_read_timeout
<http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_read_timeout>
.
However, as documentation states, the timeout is set between messages, so a
fragmented answer which takes less than the timeout for each part will
succeed.
You also have proxy_connect_timeout
<http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_connect_timeout>
and proxy_send_timeout
<http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_send_timeout>
directives, if those are more suitable to you.

To craft a custom answer, I would use:
​error_page 504 @backend_timeout;
in the proxied location, associated with:
location @backend_timeout {
    return 200 "\n";
}​
---
*B. R.*

On Wed, Nov 26, 2014 at 2:48 PM, Fritz Richter <fritz at adsquare.com> wrote:

> Hi together,
>
> we have a nginx Server serving our requests. Based on our SLAs we need to
> answer always in 7ms time. Behind the nginx Server, there is a Java
> Backend, which we proxy through the nginx.
>
> The requirement is saying, that in case we can not deliver our answer in
> 7ms, we need to respond with an empty String „\n“.
>
> Is there a ways to configure nginx in that way, that after the 7ms
> timeframe it will not wait for the backend systems answer but respond with
> this empty String?
>
> Thanks for your help
> fri
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20141126/e0007d4a/attachment-0001.html>


More information about the nginx mailing list