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