Merge pull request #970 from SkynetLabs/fix-internal-nginx-timeouts

fix issue with "unexpected end of file" in health checks on subdomain test
This commit is contained in:
Karol Wypchło 2021-07-09 15:28:48 +02:00 committed by GitHub
commit 972a92fa06
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 3 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 '';
@ -480,19 +484,21 @@ server {
} }
proxy_set_header Dnslink-Lookup ""; proxy_set_header Dnslink-Lookup "";
proxy_pass http://127.0.0.1/$dnslink/$request_uri; proxy_pass http://127.0.0.1/$dnslink$request_uri;
} }
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;
} }
location @purge { location @purge {
@ -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;