certbot cannot issue for internal hostnames (*.nas.local), which made nginx-enabled services with internal names fail on deploy. Add a <service>_nginx_letsencrypt flag (default false) and computed <service>_nginx_ssl_certificate/_key paths: when off the vhost uses the shared self-signed cert (nginx_default_ssl_cert), when on it uses the Let's Encrypt lineage. Gate the certbot include on the flag and apply the pattern to all service roles (deluge, fdroid, gitea, grafana, immich, metabase, ntfy, prowlarr, radarr, seerr, static_web, uptime_kuma).
50 lines
1.6 KiB
Django/Jinja
50 lines
1.6 KiB
Django/Jinja
# Metabase vhost
|
|
# Managed by Ansible - DO NOT EDIT MANUALLY
|
|
|
|
server {
|
|
listen 80;
|
|
listen [::]:80;
|
|
server_name {{ metabase_nginx_hostname }};
|
|
|
|
location /.well-known/acme-challenge/ {
|
|
root /var/www/certbot;
|
|
}
|
|
location / {
|
|
return 301 https://$server_name$request_uri;
|
|
}
|
|
}
|
|
|
|
server {
|
|
listen 443 ssl;
|
|
listen [::]:443 ssl;
|
|
http2 on;
|
|
server_name {{ metabase_nginx_hostname }};
|
|
|
|
ssl_certificate {{ metabase_nginx_ssl_certificate }};
|
|
ssl_certificate_key {{ metabase_nginx_ssl_certificate_key }};
|
|
ssl_protocols {{ nginx_ssl_protocols | default('TLSv1.3') }};
|
|
ssl_prefer_server_ciphers on;
|
|
|
|
{% if nginx_log_backend | default('journald') == 'journald' %}
|
|
access_log syslog:server=unix:/dev/log,nohostname,tag=nginx_metabase;
|
|
error_log syslog:server=unix:/dev/log,nohostname,tag=nginx_metabase;
|
|
{% else %}
|
|
access_log /var/log/nginx/{{ metabase_nginx_hostname }}_access.log main;
|
|
error_log /var/log/nginx/{{ metabase_nginx_hostname }}_error.log;
|
|
{% endif %}
|
|
|
|
location / {
|
|
proxy_pass http://127.0.0.1:{{ metabase_port }};
|
|
proxy_set_header Host $http_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_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection "upgrade";
|
|
proxy_connect_timeout 60s;
|
|
proxy_read_timeout 600s;
|
|
proxy_send_timeout 600s;
|
|
}
|
|
}
|