proxy_read_timeout per service

411 views
Skip to first unread message

RJoshi

unread,
Sep 7, 2014, 11:58:15 AM9/7/14
to openre...@googlegroups.com
Hello,
  Is it possible to set the proxy_read_timeout based on the upstream service?  Currently we use Oracle OSB which provides a configurable connection and request timeout per business service.
  
 I am trying to add support for request timeout using nginx proxy_read_timeout directive. 
 When I set this directive with variable , it  gives below error.

nginx: [emerg] "proxy_read_timeout" directive invalid value in /opt/openresty/nginx/conf/nginx.conf:100

below is my configuration.  Here $request_timeout variable is set in rewrite_by_lua handler based on service configuration.

 proxy_read_timeout $request_timeout;  #TODO  need to figure out how to set read timeout
 proxy_ssl_name $ssl_server_name;
 proxy_pass https://$upstream$new_uri;  

I see similar question was posted here http://mailman.nginx.org/pipermail/nginx/2007-May/001031.html   but not sure 
1.  how much is overhead for internal rewrite
2.  It is not really service/request based and add have to multiple locations based on different timeout values.



 

Yichun Zhang (agentzh)

unread,
Sep 7, 2014, 4:23:10 PM9/7/14
to openresty-en
Hello!

On Sun, Sep 7, 2014 at 8:58 AM, RJoshi wrote:
> I am trying to add support for request timeout using nginx
> proxy_read_timeout directive.
> When I set this directive with variable , it gives below error.
>

This directive (as well as other proxy_xxxx_timeout directives) does
not support nginx variables. You need to patch the standard ngx_proxy
module to add support for that :)

> 1. how much is overhead for internal rewrite

Usually neglect-able. But you can always measure it yourself.

> 2. It is not really service/request based and add have to multiple
> locations based on different timeout values.
>

The best way is to let proxy_xxxx_timeout directives support nginx
variables. You're welcome to submit patches to the nginx-devel mailing
list.

Regards,
-agentzh

Rohit Joshi

unread,
Sep 7, 2014, 6:01:23 PM9/7/14
to openre...@googlegroups.com
Sure, will work on adding support.

I planning to upgrade from RC1 to RC2. Are you planning to include my patch for upstream two way SSL in nginx in future release?
> --
> You received this message because you are subscribed to a topic in the Google Groups "openresty-en" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/openresty-en/zfpLn1IN6zc/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to openresty-en...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Yichun Zhang (agentzh)

unread,
Sep 7, 2014, 11:15:40 PM9/7/14
to openresty-en
Hello!

On Sun, Sep 7, 2014 at 3:01 PM, Rohit Joshi wrote:
> I planning to upgrade from RC1 to RC2.

Cool.

> Are you planning to include my patch for upstream two way SSL in nginx in future release?
>

Usually I do not add such new directives to OpenResty's nginx because
if the upstream nginx decides to expose a different UI in the near
future, then I'll have to maintain our duplicated but slightly
different UI forever.

That's why I've been encouraging you to get these merged in the upstream nginx.

Regards,
-agentzh
Reply all
Reply to author
Forward
0 new messages