From 84d31fed001b4e2f83703973191f3d52e61d33c7 Mon Sep 17 00:00:00 2001 From: Karol Wypchlo Date: Fri, 9 Jul 2021 13:58:55 +0200 Subject: [PATCH] increase timeouts on nginx locations that proxy pass internally --- docker/nginx/conf.d/client.conf | 7 +++++++ docker/nginx/conf.d/include/proxy-pass-internal | 10 ++++++++++ 2 files changed, 17 insertions(+) create mode 100644 docker/nginx/conf.d/include/proxy-pass-internal diff --git a/docker/nginx/conf.d/client.conf b/docker/nginx/conf.d/client.conf index 123516fb..96304431 100644 --- a/docker/nginx/conf.d/client.conf +++ b/docker/nginx/conf.d/client.conf @@ -142,6 +142,7 @@ server { location /hns { include /etc/nginx/conf.d/include/proxy-buffer; + include /etc/nginx/conf.d/include/proxy-pass-internal; # variable definititions - we need to define a variable to be able to access it in lua by ngx.var.something set $skylink ''; # placeholder for the raw 46 bit skylink @@ -244,6 +245,8 @@ server { # it is not suitable for every registry call but some requests might be cached # and we are using it currently for caching registry resolutions from /hns calls location /skynet/registry/cached { + include /etc/nginx/conf.d/include/proxy-pass-internal; + internal; # internal endpoint only access_log off; # do not log traffic @@ -460,6 +463,7 @@ server { location @dnslink_lookup { include /etc/nginx/conf.d/include/proxy-buffer; + include /etc/nginx/conf.d/include/proxy-pass-internal; set $dnslink ''; @@ -485,12 +489,14 @@ server { location @base32_subdomain { include /etc/nginx/conf.d/include/proxy-buffer; + include /etc/nginx/conf.d/include/proxy-pass-internal; proxy_pass http://127.0.0.1/$base32_subdomain/$request_uri; } location @hns_domain { include /etc/nginx/conf.d/include/proxy-buffer; + include /etc/nginx/conf.d/include/proxy-pass-internal; proxy_pass http://127.0.0.1/hns/$hns_domain/$request_uri; } @@ -508,6 +514,7 @@ server { location ~ "^/file/([a-zA-Z0-9-_]{46}(/.*)?)$" { include /etc/nginx/conf.d/include/proxy-buffer; + include /etc/nginx/conf.d/include/proxy-pass-internal; rewrite /file/(.*) $1 break; # drop the /file/ prefix from uri diff --git a/docker/nginx/conf.d/include/proxy-pass-internal b/docker/nginx/conf.d/include/proxy-pass-internal new file mode 100644 index 00000000..2c17de5e --- /dev/null +++ b/docker/nginx/conf.d/include/proxy-pass-internal @@ -0,0 +1,10 @@ +# ---------------------------------------------------------------- +# this file should be included on all locations that proxy_pass to +# another nginx location - internal nginx traffic +# ---------------------------------------------------------------- + +# increase the timeout on internal nginx proxy_pass locations to a +# value that is significantly higher than expected and let the end +# location handle correct timeout +proxy_read_timeout 30m; +proxy_send_timeout 30m; \ No newline at end of file