increase timeouts on nginx locations that proxy pass internally

This commit is contained in:
Karol Wypchlo 2021-07-09 13:58:55 +02:00
parent e0a1c23ca5
commit 84d31fed00
2 changed files with 17 additions and 0 deletions

View File

@ -142,6 +142,7 @@ server {
location /hns { location /hns {
include /etc/nginx/conf.d/include/proxy-buffer; 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 # 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 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 # 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 # and we are using it currently for caching registry resolutions from /hns calls
location /skynet/registry/cached { location /skynet/registry/cached {
include /etc/nginx/conf.d/include/proxy-pass-internal;
internal; # internal endpoint only internal; # internal endpoint only
access_log off; # do not log traffic access_log off; # do not log traffic
@ -460,6 +463,7 @@ server {
location @dnslink_lookup { location @dnslink_lookup {
include /etc/nginx/conf.d/include/proxy-buffer; include /etc/nginx/conf.d/include/proxy-buffer;
include /etc/nginx/conf.d/include/proxy-pass-internal;
set $dnslink ''; set $dnslink '';
@ -485,12 +489,14 @@ server {
location @base32_subdomain { location @base32_subdomain {
include /etc/nginx/conf.d/include/proxy-buffer; 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; proxy_pass http://127.0.0.1/$base32_subdomain/$request_uri;
} }
location @hns_domain { location @hns_domain {
include /etc/nginx/conf.d/include/proxy-buffer; 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; proxy_pass http://127.0.0.1/hns/$hns_domain/$request_uri;
} }
@ -508,6 +514,7 @@ server {
location ~ "^/file/([a-zA-Z0-9-_]{46}(/.*)?)$" { location ~ "^/file/([a-zA-Z0-9-_]{46}(/.*)?)$" {
include /etc/nginx/conf.d/include/proxy-buffer; 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 rewrite /file/(.*) $1 break; # drop the /file/ prefix from uri

View File

@ -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;