From e49bb4321102d3fcee39dedc91137e060fe54279 Mon Sep 17 00:00:00 2001 From: missytake Date: Mon, 11 Mar 2024 17:48:17 +0100 Subject: [PATCH] nginx: fix acmetool-redirector/nginx setup --- pyinfra_nginx/nginx.py | 7 ++++++- pyinfra_nginx/proxy_pass.nginx_config.j2 | 2 -- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/pyinfra_nginx/nginx.py b/pyinfra_nginx/nginx.py index cc2e753..05f2186 100644 --- a/pyinfra_nginx/nginx.py +++ b/pyinfra_nginx/nginx.py @@ -31,7 +31,12 @@ def add_nginx_domain(domain: str, config_path: str = None, proxy_port: int = Non default_config_link = files.link( path="/etc/nginx/sites-enabled/default", present=False ) - need_restart = default_config_link.changed + if default_config_link.changed: + systemd.service( + name="reload nginx", + service="nginx.service", + reloaded=True, + ) if acmetool: deploy_acmetool(nginx_hook=True, domains=[domain]) diff --git a/pyinfra_nginx/proxy_pass.nginx_config.j2 b/pyinfra_nginx/proxy_pass.nginx_config.j2 index be9cadd..f2968be 100644 --- a/pyinfra_nginx/proxy_pass.nginx_config.j2 +++ b/pyinfra_nginx/proxy_pass.nginx_config.j2 @@ -14,6 +14,4 @@ server { listen 443 ssl http2; ssl_certificate /var/lib/acme/live/{{ domain }}/fullchain; # managed by acmetool ssl_certificate_key /var/lib/acme/live/{{ domain }}/privkey; # managed by acmetool - include /etc/letsencrypt/options-ssl-nginx.conf; - ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; }