Skip to content

Commit af5c2d9

Browse files
feat(nginx/config): allow overwrite of proxy_read_timeout through yaml (#615)
1 parent f862dd5 commit af5c2d9

6 files changed

Lines changed: 8 additions & 7 deletions

File tree

nginx/config/agent.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ server {
3737
access_log {{.access_log_path}};
3838
error_log {{.error_log_path}};
3939
40+
proxy_read_timeout {{if .proxy_read_timeout}}{{.proxy_read_timeout}}{{else}}10m{{end}};
41+
4042
gzip on;
4143
gzip_types text/plain test/csv application/json;
4244

nginx/config/build-index.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ server {
5050
proxy_cache_valid any 1s;
5151
proxy_cache_lock on;
5252
53-
proxy_read_timeout {{.proxy_read_timeout}};
53+
proxy_read_timeout {{if .proxy_read_timeout}}{{.proxy_read_timeout}}{{else}}3m{{end}};
5454
}
5555
5656
location ~* ^/repositories/.*/tags$ {
@@ -71,7 +71,7 @@ server {
7171
proxy_cache_valid any 1s;
7272
proxy_cache_lock on;
7373
74-
proxy_read_timeout {{.proxy_read_timeout}};
74+
proxy_read_timeout {{if .proxy_read_timeout}}{{.proxy_read_timeout}}{{else}}3m{{end}};
7575
}
7676
}
7777
`

nginx/config/origin.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ server {
2929
gzip_types text/plain test/csv application/json;
3030
3131
# Committing large blobs might take a while.
32-
proxy_read_timeout {{.proxy_read_timeout}};
32+
proxy_read_timeout {{if .proxy_read_timeout}}{{.proxy_read_timeout}}{{else}}3m{{end}};
3333
3434
proxy_set_header traceparent $http_traceparent;
3535
proxy_set_header tracestate $http_tracestate;

nginx/config/proxy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ server {
4242
gzip_types text/plain test/csv application/json;
4343
4444
# Committing large blobs might take a while.
45-
proxy_read_timeout 3m;
45+
proxy_read_timeout {{if $.proxy_read_timeout}}{{$.proxy_read_timeout}}{{else}}3m{{end}};
4646
4747
{{healthEndpoint "proxy-server"}}
4848

nginx/config/tracker.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ server {
2929
access_log {{.access_log_path}};
3030
error_log {{.error_log_path}};
3131
32+
proxy_read_timeout {{if .proxy_read_timeout}}{{.proxy_read_timeout}}{{else}}60s{{end}};
33+
3234
{{healthEndpoint "tracker"}}
3335
3436
location / {

nginx/nginx.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,6 @@ func (c *Config) applyDefaults() error {
8484
}
8585
c.ErrorLogPath = filepath.Join(c.LogDir, "nginx-error.log")
8686
}
87-
if c.ProxyTimeout == "" {
88-
c.ProxyTimeout = "3m"
89-
}
9087
return nil
9188
}
9289

0 commit comments

Comments
 (0)