Dynamic timeout on proxy in nginx.conf

39 views
Skip to first unread message

kushal khatri

unread,
Dec 9, 2016, 3:55:05 PM12/9/16
to openresty-en
Hey guys,

We're calling URLs outbound by calling a proxy in the nginx.conf file. The proxy looks like this right now :

location /abc {
proxy_pass http://abc.com;
proxy_connect_timeout 500ms;
proxy_read_timeout 500ms;
}

By default we use 500ms timeout, but is there a way to pass a dynamic timeout to the proxy call? 

So something like this:

location /abc?timeout=x {
proxy_pass http://abc.com;
proxy_connect_timeout xms;
proxy_read_timeout xms;
}

Is there a way to pass a parameter to the proxy call, parse it out and use that as the timeout ?

Thanks.
Reply all
Reply to author
Forward
0 new messages