Add PROXY protocol - not working yet

This commit is contained in:
baudneo
2022-10-09 15:56:06 -06:00
parent 5ed6f3d995
commit 2feb6ccf08
10 changed files with 119 additions and 8 deletions

View File

@@ -1,15 +1,25 @@
{% if enable_proxy_protocol == 1 or enable_proxy_protocol == true%}
listen 88 proxy_protocol;
{% if ipv6 -%}
listen [::]:88 proxy_protocol;
{% endif %}
{% else -%}
listen 80;
{% if ipv6 -%}
listen [::]:80;
{% else -%}
#listen [::]:80;
{% endif %}
{% endif %}
{% if certificate -%}
{% if enable_proxy_protocol == 1 or enable_proxy_protocol == true%}
listen 444 ssl{% if http2_support %} http2{% endif %} proxy_protocol;
{% if ipv6 -%}
listen [::]:444 ssl{% if http2_support %} http2{% endif %} proxy_protocol;
{% endif %}
{% else -%}
listen 443 ssl{% if http2_support %} http2{% endif %};
{% if ipv6 -%}
listen [::]:443 ssl{% if http2_support %} http2{% endif %};
{% else -%}
#listen [::]:443;
{% endif %}
{% endif %}
{% endif %}
server_name {{ domain_names | join: " " }};

View File

@@ -0,0 +1,6 @@
{% if enable_proxy_protocol == 1 or enable_proxy_protocol == true %}
{% if load_balancer_ip != '' %}
set_real_ip_from {{ load_balancer_ip }};
real_ip_header proxy_protocol;
{% endif %}
{% endif %}

View File

@@ -12,6 +12,7 @@ server {
{% include "_exploits.conf" %}
{% include "_hsts.conf" %}
{% include "_forced_ssl.conf" %}
{% include "_proxy_protocol.conf" %}
{% if allow_websocket_upgrade == 1 or allow_websocket_upgrade == true %}
proxy_set_header Upgrade $http_upgrade;