36 lines
1.0 KiB
Plaintext
36 lines
1.0 KiB
Plaintext
# ----------------------------------------------------
|
|
# 80 - ACME Challenge + Redirect to HTTPS for homepage
|
|
# ----------------------------------------------------
|
|
server {
|
|
listen 80;
|
|
server_name {{ xcontrol_homepage_domain }};
|
|
|
|
location ^~ /.well-known/acme-challenge/ {
|
|
root /var/www/certbot;
|
|
}
|
|
|
|
location / {
|
|
return 301 https://$host$request_uri;
|
|
}
|
|
}
|
|
|
|
# ----------------------------------------------------
|
|
# 443 - TLS Termination for homepage
|
|
# ----------------------------------------------------
|
|
server {
|
|
listen 443 ssl http2;
|
|
server_name {{ xcontrol_homepage_domain }};
|
|
|
|
ssl_certificate /etc/letsencrypt/live/{{ xcontrol_primary_domain }}/fullchain.pem;
|
|
ssl_certificate_key /etc/letsencrypt/live/{{ xcontrol_primary_domain }}/privkey.pem;
|
|
|
|
ssl_protocols TLSv1.2 TLSv1.3;
|
|
ssl_prefer_server_ciphers on;
|
|
|
|
location / {
|
|
proxy_pass http://dashboard:3000;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Forwarded-Proto https;
|
|
}
|
|
}
|