Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Periodic DNS resolution #136

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions common/etc/nginx/templates/default.conf.template
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ js_set $s3uri s3gateway.s3uri;
server {
include /etc/nginx/conf.d/gateway/server_variables.conf;

# Set the hostname to a variable to be used with proxy_pass so that we can
# re-resolve the hostname as described here:
# https://www.nginx.com/blog/dns-service-discovery-nginx-plus/#domain-name-variable
set $upstream_server ${S3_SERVER}:${S3_SERVER_PORT};

# Don't display the NGINX version number because we don't want to reveal
# information that could be used to find an exploit.
server_tokens off;
Expand Down Expand Up @@ -136,7 +141,7 @@ server {

error_page 404 @trailslashControl;

proxy_pass ${S3_SERVER_PROTO}://storage_urls$s3uri;
proxy_pass ${S3_SERVER_PROTO}://$upstream_server$s3uri;

include /etc/nginx/conf.d/gateway/s3_location.conf;
}
Expand Down Expand Up @@ -194,7 +199,7 @@ server {
# Comment out this line to receive the error messages returned by S3
error_page 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 420 422 423 424 426 428 429 431 444 449 450 451 500 501 502 503 504 505 506 507 508 509 510 511 =404 @error404;

proxy_pass ${S3_SERVER_PROTO}://storage_urls$s3uri;
proxy_pass ${S3_SERVER_PROTO}://$upstream_server$s3uri;
include /etc/nginx/conf.d/gateway/s3listing_location.conf;
}

Expand Down
2 changes: 2 additions & 0 deletions common/etc/nginx/templates/resolver.conf.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Use NGINX's non-blocking DNS resolution
resolver ${DNS_RESOLVERS};
11 changes: 0 additions & 11 deletions oss/etc/nginx/templates/upstreams.conf.template

This file was deleted.

13 changes: 0 additions & 13 deletions plus/etc/nginx/templates/upstreams.conf.template

This file was deleted.