Skip to content

Commit 50925c1

Browse files
authored
Increase origin timeouts to 3m (#497)
* Increase origin timeouts to 3m * Fix * Fix
1 parent 1dc0775 commit 50925c1

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

nginx/config/origin.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ server {
2828
gzip on;
2929
gzip_types text/plain test/csv application/json;
3030
31+
# Committing large blobs might take a while.
32+
proxy_read_timeout {{.proxy_read_timeout}};
33+
3134
{{healthEndpoint .server}}
3235
3336
location / {

nginx/nginx.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ type Config struct {
5555
AccessLogPath string `yaml:"access_log_path"`
5656
ErrorLogPath string `yaml:"error_log_path"`
5757

58+
// ProxyTimeout defines the proxy_read_timeout for nginx (e.g. "15m", "3m", "60s")
59+
ProxyTimeout string `yaml:"proxy_timeout"`
60+
5861
tls httputil.TLSConfig
5962
}
6063

@@ -80,6 +83,9 @@ func (c *Config) applyDefaults() error {
8083
}
8184
c.ErrorLogPath = filepath.Join(c.LogDir, "nginx-error.log")
8285
}
86+
if c.ProxyTimeout == "" {
87+
c.ProxyTimeout = "3m"
88+
}
8389
return nil
8490
}
8591

@@ -120,6 +126,10 @@ func (c *Config) Build(params map[string]interface{}) ([]byte, error) {
120126
if _, ok := params["client_verification"]; !ok {
121127
params["client_verification"] = config.DefaultClientVerification
122128
}
129+
// Add proxy_read_timeout to params for site template
130+
if _, ok := params["proxy_read_timeout"]; !ok {
131+
params["proxy_read_timeout"] = c.ProxyTimeout
132+
}
123133
site, err := populateTemplate(tmpl, params)
124134
if err != nil {
125135
return nil, fmt.Errorf("populate template: %s", err)

0 commit comments

Comments
 (0)