mirror of
https://github.com/deuill/coreos-home-server.git
synced 2024-09-21 13:40:45 +00:00
Alex Palaistras
eda658f99d
This commit moves the `nginx-proxy-http` service back to separate `UPSTREAM_HOST`, `UPSTREAM_PORT`, and `UPSTREAM_PATH` variables, which allows for more granular configuration, e.g. `proxy_redirect` patterns.
27 lines
883 B
Plaintext
27 lines
883 B
Plaintext
server {
|
|
listen 80;
|
|
server_name ${SERVER_NAME} ${SERVER_NAME_ALT};
|
|
return 301 https://$host$request_uri;
|
|
}
|
|
|
|
server {
|
|
listen 443 ssl;
|
|
server_name ${SERVER_NAME} ${SERVER_NAME_ALT};
|
|
|
|
ssl_certificate /etc/ssl/private/certificates/${SSL_CERT_NAME}.crt;
|
|
ssl_certificate_key /etc/ssl/private/certificates/${SSL_CERT_NAME}.key;
|
|
|
|
include resolver.conf;
|
|
set $upstream_endpoint http://${UPSTREAM_HOST}:${UPSTREAM_PORT}${UPSTREAM_PATH};
|
|
|
|
location / {
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
proxy_pass $upstream_endpoint$request_uri;
|
|
proxy_redirect http://$upstream_endpoint /;
|
|
proxy_redirect http://${SERVER_NAME}:${UPSTREAM_PORT}${UPSTREAM_PATH} /;
|
|
}
|
|
}
|