Files
it-ansible/docker_compose_applications/reverse-proxy/conf.d/acme_challenge.conf
Julian Schacher 75830e445b Deploy a reverse proxy doing PROXY Protocol
This is needed to be able to nicely host multiple services under a
single IPv4.
The reverse proxy also includes a configuration to pass requests for
acme challenge properly.
And lastly the reverse proxy is already configured for a stirling pdf,
which gets added once the DNS record for it is in place.
2024-02-07 19:16:32 +01:00

24 lines
655 B
Plaintext

map $host $upstream_acme_challenge_host {
pdf.consider-it.de 127.0.0.1:8000;
default "";
}
server {
listen 80 default_server;
location /.well-known/acme-challenge/ {
proxy_pass http://$upstream_acme_challenge_host;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# This is http in any case.
proxy_set_header X-Forwarded-Proto http;
}
# Better safe than sorry.
# Don't do a permanent redirect to avoid acme challenge pain.
location / {
return 307 https://$host$request_uri;
}
}