From 86b8b1b12be635234fc6f8fe19ff59806d8a9662 Mon Sep 17 00:00:00 2001 From: Jean-Marie Mineau Date: Sun, 7 Aug 2022 18:46:03 +0200 Subject: [PATCH] add dedicated logs to http sites --- templates/http_server.j2 | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/templates/http_server.j2 b/templates/http_server.j2 index 2c3aa71..9f0fefc 100644 --- a/templates/http_server.j2 +++ b/templates/http_server.j2 @@ -4,16 +4,20 @@ server { listen [::]:80; server_name {{ item.key }}; - # Redirect to https - location / { - return 302 https://$host$request_uri; - } + + access_log /var/log/nginx/http_{{ item.key }}.log; + error_log /var/log/nginx/http_{{ item.key }}_error.log; # ACME directory, to limit interaction with certbot location /.well-known/acme-challenge/ { root /var/www/well-known/acme-challenge/; } + # Redirect to https + location / { + return 302 https://$host$request_uri; + } + include /etc/nginx/mime.types; default_type application/octet-stream;