From b8978cb955a9cb838fd17968f7f4634eadb48b3f Mon Sep 17 00:00:00 2001 From: baudneo <86508179+baudneo@users.noreply.github.com> Date: Mon, 10 Oct 2022 12:07:07 -0600 Subject: [PATCH] add PROXY to 404, redirection and default host. --- backend/templates/dead_host.conf | 1 + backend/templates/default.conf | 12 +++++++++--- backend/templates/redirection_host.conf | 1 + 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/backend/templates/dead_host.conf b/backend/templates/dead_host.conf index d94dff57..b632933b 100644 --- a/backend/templates/dead_host.conf +++ b/backend/templates/dead_host.conf @@ -6,6 +6,7 @@ server { {% include "_certificates.conf" %} {% include "_hsts.conf" %} {% include "_forced_ssl.conf" %} +{% include "_proxy_protocol.conf" %} access_log /data/logs/dead-host-{{ id }}_access.log standard; error_log /data/logs/dead-host-{{ id }}_error.log warn; diff --git a/backend/templates/default.conf b/backend/templates/default.conf index ec68530c..9099f6ef 100644 --- a/backend/templates/default.conf +++ b/backend/templates/default.conf @@ -2,19 +2,25 @@ # Default Site # ------------------------------------------------------------ {% if value == "congratulations" %} -# Skipping output, congratulations page configration is baked in. +# Skipping output, congratulations page configuration is baked in. {%- else %} server { +{% if enable_proxy_protocol == 1 or enable_proxy_protocol == true%} + listen 88 proxy_protocol; +{% if ipv6 -%} + listen [::]:88 proxy_protocol; +{% endif %} +{% else -%} listen 80 default; {% if ipv6 -%} listen [::]:80 default; -{% else -%} - #listen [::]:80 default; +{% endif %} {% endif %} server_name default-host.localhost; access_log /data/logs/default-host_access.log combined; error_log /data/logs/default-host_error.log warn; {% include "_exploits.conf" %} +{% include "_proxy_protocol.conf"} include conf.d/include/letsencrypt-acme-challenge.conf; diff --git a/backend/templates/redirection_host.conf b/backend/templates/redirection_host.conf index 339fe72e..3e7e7eba 100644 --- a/backend/templates/redirection_host.conf +++ b/backend/templates/redirection_host.conf @@ -8,6 +8,7 @@ server { {% include "_exploits.conf" %} {% include "_hsts.conf" %} {% include "_forced_ssl.conf" %} +{% include "_proxy_protocol.conf" %} access_log /data/logs/redirection-host-{{ id }}_access.log standard; error_log /data/logs/redirection-host-{{ id }}_error.log warn;