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.
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user