Skip to content

Commit db4c6e9

Browse files
authored
Allow configuring read and send timeout in Nginx (#305)
* allow configuring read and write timeout in nginx * tweaking the comment
1 parent 208386a commit db4c6e9

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

prometheus-ksonnet/lib/config.libsonnet

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,5 +86,10 @@
8686

8787
// oauth2-proxy
8888
oauth_enabled: false,
89+
90+
// Nginx proxy_read_timeout (in seconds) 60s is the nginx default
91+
nginx_proxy_read_timeout: '60',
92+
// Nginx proxy_send_timeout (in seconds) 60s is the nginx default
93+
nginx_proxy_send_timeout: '60',
8994
},
9095
}

prometheus-ksonnet/lib/nginx.libsonnet

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
1010
proxy_set_header X-Forwarded-Proto $scheme;
1111
proxy_set_header X-Forwarded-Host $http_host;
12-
||| % service + if allowWebsockets then |||
12+
proxy_read_timeout %(nginx_proxy_read_timeout)s;
13+
proxy_send_timeout %(nginx_proxy_send_timeout)s;
14+
||| % (service + $._config) + if allowWebsockets then |||
1315
# Allow websocket connections https://www.nginx.com/blog/websocket-nginx/
1416
proxy_set_header Upgrade $http_upgrade;
1517
proxy_set_header Connection "Upgrade";

0 commit comments

Comments
 (0)