Fix resolver issue in reverse proxies

This commit is contained in:
Wojciech Kozlowski 2023-07-30 10:39:55 +02:00
parent a5aecd0b46
commit c44066334e
2 changed files with 4 additions and 0 deletions

View File

@ -27,6 +27,8 @@ http {
#gzip on; #gzip on;
include /etc/nginx/resolver.conf;
# Configuration based on https://raymii.org/s/tutorials/Strong_SSL_Security_On_nginx.html. # Configuration based on https://raymii.org/s/tutorials/Strong_SSL_Security_On_nginx.html.
# SSL protocols. # SSL protocols.

View File

@ -11,6 +11,7 @@ OnFailure=status-mail@%n.service
Environment=PODMAN_SYSTEMD_UNIT=%n Environment=PODMAN_SYSTEMD_UNIT=%n
Restart=on-failure Restart=on-failure
TimeoutStopSec=70 TimeoutStopSec=70
ExecStartPre=/usr/bin/sh -c 'echo resolver $(awk '\''BEGIN{ORS=" "} $1=="nameserver" {print $2}'\'' {{ system_etc_root_directory }}/resolv.conf) ";" > %t/resolver.conf'
ExecStartPre=/bin/rm -f %t/container-{{ services_service_name }}-nginx.pid %t/container-{{ services_service_name }}-nginx.ctr-id ExecStartPre=/bin/rm -f %t/container-{{ services_service_name }}-nginx.pid %t/container-{{ services_service_name }}-nginx.ctr-id
ExecStart=/usr/bin/podman run \ ExecStart=/usr/bin/podman run \
--conmon-pidfile %t/container-{{ services_service_name }}-nginx.pid \ --conmon-pidfile %t/container-{{ services_service_name }}-nginx.pid \
@ -24,6 +25,7 @@ ExecStart=/usr/bin/podman run \
{{ services_rproxy_nginx_add_inet_hosts }} \ {{ services_rproxy_nginx_add_inet_hosts }} \
{{ services_rproxy_nginx_add_inet6_hosts }} \ {{ services_rproxy_nginx_add_inet6_hosts }} \
-v {{ system_etc_root_directory }}/resolv.conf:/etc/resolv.conf:ro \ -v {{ system_etc_root_directory }}/resolv.conf:/etc/resolv.conf:ro \
-v %t/resolver.conf:/etc/nginx/resolver.conf:ro \
-v ./.config/service/nginx.conf:/etc/nginx/nginx.conf:ro \ -v ./.config/service/nginx.conf:/etc/nginx/nginx.conf:ro \
-v ./.config/service/stream.conf:/etc/nginx/stream.conf:ro \ -v ./.config/service/stream.conf:/etc/nginx/stream.conf:ro \
-v ./.config/service/nginx-conf.d:/etc/nginx/conf.d:ro \ -v ./.config/service/nginx-conf.d:/etc/nginx/conf.d:ro \