Skip to content

Commit 479095f

Browse files
Add ability to configure Nginx DNS resolver (#3275)
1 parent b7f4fcc commit 479095f

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

docker-compose.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,10 @@ services:
334334
environment:
335335
OPENVERSE_NGINX_UPSTREAM_URL: ${HOST_NETWORK_ADDRESS}:8443
336336
OPENVERSE_NGINX_PLAUSIBLE_EVENT_URL: http://plausible:8000/api/event
337+
# Set to Docker network resolver to be able to resolve the `plausible` container.
338+
# This would be the default but Nginx requires it to be explicitly set when
339+
# making outgoing requests (e.g., to plausible.io)
340+
OPENVERSE_NGINX_DNS_RESOLVER: 127.0.0.11
337341

338342
volumes:
339343
api-postgres:

frontend/nginx.conf.template

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
# - OPENVERSE_NGINX_GIT_REVISION
66
# - OPENVERSE_NGINX_ENVIRONMENT
77
# - OPENVERSE_NGINX_PLAUSIBLE_EVENT_URL
8+
# - OPENVERSE_NGINX_DNS_RESOLVER
89

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

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

0 commit comments

Comments
 (0)