From 7d29bb73c486ef58ab8661d5120883b4953d6d8a Mon Sep 17 00:00:00 2001 From: phil Date: Mon, 16 Jan 2023 15:52:08 +0100 Subject: [PATCH] =?UTF-8?q?apache2:=20Erm=C3=B6gliche=20Logging=20der=20Re?= =?UTF-8?q?moteIP?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tasks/configuration.yml | 9 ++++++--- templates/remoteip.conf | 4 ++++ 2 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 templates/remoteip.conf diff --git a/tasks/configuration.yml b/tasks/configuration.yml index a04be16..b8e1aa4 100644 --- a/tasks/configuration.yml +++ b/tasks/configuration.yml @@ -30,11 +30,14 @@ - letsencrypt.conf - sao-cache.conf -- name: "configuration | Kopiere SSL-Konfiguration" +- name: "configuration | Kopiere Templates" ansible.builtin.template: - src: ssl.conf - dest: /etc/apache2/conf-available/ssl.conf + src: "{{ item }}" + dest: /etc/apache2/conf-available/ mode: 0644 + loop: + - remoteip.conf + - ssl.conf - name: "configuration | Aktiviere Module" ansible.builtin.apache2_module: diff --git a/templates/remoteip.conf b/templates/remoteip.conf new file mode 100644 index 0000000..22892df --- /dev/null +++ b/templates/remoteip.conf @@ -0,0 +1,4 @@ +RemoteIPHeader X-Forwarded-For +RemoteIPTrustedProxy {{ gateway_host_ip }} + +LogFormat "%a %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" remotip