2022-11-23 20:10:13 +01:00
|
|
|
#
|
|
|
|
# BEGIN: bind-direct.cnf
|
|
|
|
#
|
|
|
|
bind :80
|
|
|
|
http-request redirect scheme https code 301 unless { ssl_fc }
|
|
|
|
http-request del-header ssl_client_cert unless { ssl_fc_has_crt }
|
|
|
|
http-request set-header ssl_client_cert -----BEGIN\ CERTIFICATE-----\ %[ssl_c_der,base64]\ -----END\ CERTIFICATE-----\ if { ssl_fc_has_crt }
|
|
|
|
bind :443 ssl crt /certs/chain.pem
|
|
|
|
|
2022-12-02 06:49:56 +01:00
|
|
|
# This comes from the internet, do not trust the forwarding headers
|
|
|
|
http-request del-header X-Forwarded-For
|
|
|
|
http-request del-header X-Forwarded-Proto
|
|
|
|
# But add our forwarding headers instead
|
|
|
|
option forwardfor
|
2022-12-02 11:13:33 +01:00
|
|
|
# We are always doing TLS, except for redirections
|
|
|
|
http-request set-header X-SSL %[ssl_fc]
|
|
|
|
http-request set-header X-Forwarded-Proto https
|
2022-11-23 20:10:13 +01:00
|
|
|
|
|
|
|
# New line to test URI to see if its a letsencrypt request
|
|
|
|
acl letsencrypt-acl path_beg /.well-known/acme-challenge/
|
|
|
|
use_backend letsencrypt if letsencrypt-acl
|
|
|
|
#
|
|
|
|
# END: bind-direct.cnf
|
|
|
|
#
|