From a76b31cbab8d20f93e20640df164a0644bfdd1b6 Mon Sep 17 00:00:00 2001 From: NotYetAnotherRandomAnonymousUser <78692117+nyarau@users.noreply.github.com> Date: Mon, 27 May 2024 18:51:49 +0200 Subject: [PATCH] Remove hardcoded dns resolver in nginx configs --- template/nginx.conf | 2 -- template/pipedapi.conf | 7 ++++--- template/pipedfrontend.conf | 7 ++++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/template/nginx.conf b/template/nginx.conf index 2ba7091..bf9ae5f 100644 --- a/template/nginx.conf +++ b/template/nginx.conf @@ -27,7 +27,5 @@ http { keepalive_timeout 65; - resolver 127.0.0.11 ipv6=off valid=10s; - include /etc/nginx/conf.d/*.conf; } diff --git a/template/pipedapi.conf b/template/pipedapi.conf index 69db81f..7783283 100644 --- a/template/pipedapi.conf +++ b/template/pipedapi.conf @@ -1,14 +1,15 @@ proxy_cache_path /tmp/pipedapi_cache levels=1:2 keys_zone=pipedapi:4m max_size=2g inactive=60m use_temp_path=off; +upstream backend { + server piped:8080; +} server { listen 80; server_name BACKEND_HOSTNAME; - set $backend "http://piped:8080"; - location / { proxy_cache pipedapi; - proxy_pass $backend; + proxy_pass http://backend; proxy_http_version 1.1; proxy_set_header Connection "keep-alive"; } diff --git a/template/pipedfrontend.conf b/template/pipedfrontend.conf index 50c7da2..bb24922 100644 --- a/template/pipedfrontend.conf +++ b/template/pipedfrontend.conf @@ -1,11 +1,12 @@ +upstream frontend { + server pipedfrontend:80; +} server { listen 80; server_name FRONTEND_HOSTNAME; - set $backend "http://pipedfrontend:80"; - location / { - proxy_pass $backend; + proxy_pass http://frontend; proxy_http_version 1.1; proxy_set_header Connection "keep-alive"; }