From fae848bd1b0f23d9ebf14ebc8ddf651ad53002c5 Mon Sep 17 00:00:00 2001
From: chaptergy <git@chaptergy.xyz>
Date: Tue, 29 Jun 2021 20:40:36 +0200
Subject: [PATCH] Store host logs in subfolders

---
 backend/templates/dead_host.conf           | 4 ++--
 backend/templates/default.conf             | 4 ++--
 backend/templates/letsencrypt-request.conf | 4 ++--
 backend/templates/proxy_host.conf          | 4 ++--
 backend/templates/redirection_host.conf    | 4 ++--
 5 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/backend/templates/dead_host.conf b/backend/templates/dead_host.conf
index d94dff5..d942c97 100644
--- a/backend/templates/dead_host.conf
+++ b/backend/templates/dead_host.conf
@@ -7,8 +7,8 @@ server {
 {% include "_hsts.conf" %}
 {% include "_forced_ssl.conf" %}
 
-  access_log /data/logs/dead-host-{{ id }}_access.log standard;
-  error_log /data/logs/dead-host-{{ id }}_error.log warn;
+  access_log /data/logs/dead_host-{{ id }}/access.log standard;
+  error_log /data/logs/dead_host-{{ id }}/error.log warn;
 
 {{ advanced_config }}
 
diff --git a/backend/templates/default.conf b/backend/templates/default.conf
index 7eef11f..d9ba7d2 100644
--- a/backend/templates/default.conf
+++ b/backend/templates/default.conf
@@ -12,8 +12,8 @@ server {
   #listen [::]:80;
 {% endif %}
   server_name default-host.localhost;
-  access_log /data/logs/default-host_access.log combined;
-  error_log /data/logs/default-host_error.log warn;
+  access_log /data/logs/default_host/access.log combined;
+  error_log /data/logs/default_host/error.log warn;
 {% include "_exploits.conf" %}
 
 {%- if value == "404" %}
diff --git a/backend/templates/letsencrypt-request.conf b/backend/templates/letsencrypt-request.conf
index 676c8a6..afd7e46 100644
--- a/backend/templates/letsencrypt-request.conf
+++ b/backend/templates/letsencrypt-request.conf
@@ -8,8 +8,8 @@ server {
 
   server_name {{ domain_names | join: " " }};
 
-  access_log /data/logs/letsencrypt-requests_access.log standard;
-  error_log /data/logs/letsencrypt-requests_error.log warn;
+  access_log /data/logs/letsencrypt_requests/access.log standard;
+  error_log /data/logs/letsencrypt_requests/error.log warn;
 
   include conf.d/include/letsencrypt-acme-challenge.conf;
 
diff --git a/backend/templates/proxy_host.conf b/backend/templates/proxy_host.conf
index ec30cca..34f7527 100644
--- a/backend/templates/proxy_host.conf
+++ b/backend/templates/proxy_host.conf
@@ -19,8 +19,8 @@ proxy_set_header Connection $http_connection;
 proxy_http_version 1.1;
 {% endif %}
 
-  access_log /data/logs/proxy-host-{{ id }}_access.log proxy;
-  error_log /data/logs/proxy-host-{{ id }}_error.log warn;
+  access_log /data/logs/proxy_host-{{ id }}/access.log proxy;
+  error_log /data/logs/proxy_host-{{ id }}/error.log warn;
 
 {{ advanced_config }}
 
diff --git a/backend/templates/redirection_host.conf b/backend/templates/redirection_host.conf
index 339fe72..be49c1b 100644
--- a/backend/templates/redirection_host.conf
+++ b/backend/templates/redirection_host.conf
@@ -9,8 +9,8 @@ server {
 {% include "_hsts.conf" %}
 {% include "_forced_ssl.conf" %}
 
-  access_log /data/logs/redirection-host-{{ id }}_access.log standard;
-  error_log /data/logs/redirection-host-{{ id }}_error.log warn;
+  access_log /data/logs/redirection_host-{{ id }}/access.log standard;
+  error_log /data/logs/redirection_host-{{ id }}/error.log warn;
 
 {{ advanced_config }}