websites: Enable PROXY protocol for HTTPS sites

Since the reverse proxy does TLS pass-through instead of termination,
the original source address is lost.  Since the source address is
important for logging, rate limiting, and access control, we need to use
the HAProxy PROXY protocol to pass it along to the web server.

Since the PROXY protocol works at the TCP layer, _all_ connections must
use it. Fortunately, all of the sites hosted by the public web server
are in fact public and only accessed through HAProxy.  Similarly,
enabling it for one named virtual host enables it for all virtual hosts
on that port.  Thus, we only have to explicitly set it for one site, and
all the rest will use it as well.
master
Dustin 2025-08-23 22:21:54 -05:00
parent 717a8f90c6
commit 70909d1b13
2 changed files with 3 additions and 1 deletions

View File

@ -136,4 +136,4 @@ dch_proxy_backends:
servers: servers:
- name: web0 - name: web0
host: 'web0.pyrocufflink.blue:443' host: 'web0.pyrocufflink.blue:443'
options: check options: check send-proxy

View File

@ -11,6 +11,8 @@ RewriteRule (.*) https://%{SERVER_NAME}$1 [R=301,L]
<VirtualHost _default_:443> <VirtualHost _default_:443>
ServerName dustin.hatch.name ServerName dustin.hatch.name
RemoteIPProxyProtocol On
Include conf.d/ssl.include Include conf.d/ssl.include
<IfModule mod_headers.c> <IfModule mod_headers.c>