Skip to content

Add ability to configure Nginx DNS resolver #3275

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

Merged
merged 1 commit into from
Oct 31, 2023
Merged
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
4 changes: 4 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,10 @@ services:
environment:
OPENVERSE_NGINX_UPSTREAM_URL: ${HOST_NETWORK_ADDRESS}:8443
OPENVERSE_NGINX_PLAUSIBLE_EVENT_URL: http://plausible:8000/api/event
# Set to Docker network resolver to be able to resolve the `plausible` container.
# This would be the default but Nginx requires it to be explicitly set when
# making outgoing requests (e.g., to plausible.io)
OPENVERSE_NGINX_DNS_RESOLVER: 127.0.0.11

volumes:
api-postgres:
Expand Down
3 changes: 2 additions & 1 deletion frontend/nginx.conf.template
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# - OPENVERSE_NGINX_GIT_REVISION
# - OPENVERSE_NGINX_ENVIRONMENT
# - OPENVERSE_NGINX_PLAUSIBLE_EVENT_URL
# - OPENVERSE_NGINX_DNS_RESOLVER

error_log /var/log/nginx/error.log;

Expand Down Expand Up @@ -69,7 +70,7 @@ server {
# This is Docker's internal DNS resolver
# In localhost it will resolve the local Plausible and forward anything else to the host
# In production, AWS replaces
resolver 127.0.0.11;
resolver $OPENVERSE_NGINX_DNS_RESOLVER;
set $plausible_event_url $OPENVERSE_NGINX_PLAUSIBLE_EVENT_URL;
location = /api/event {
proxy_pass $plausible_event_url;
Expand Down