41 lines
1.2 KiB
Plaintext
41 lines
1.2 KiB
Plaintext
## Example Nginx server block for Umami analytics dashboard and tracker.
|
|
##
|
|
## - Replace `analytics.degelas.be` with your chosen subdomain.
|
|
## - Ensure this is included in your main Nginx config on the server.
|
|
|
|
server {
|
|
listen 80;
|
|
listen [::]:80;
|
|
server_name analytics.degelas.be;
|
|
|
|
# Redirect all HTTP to HTTPS
|
|
return 301 https://$host$request_uri;
|
|
}
|
|
|
|
server {
|
|
listen 443 ssl http2;
|
|
listen [::]:443 ssl http2;
|
|
server_name analytics.degelas.be;
|
|
|
|
# TLS configuration (certificates managed by your preferred method, e.g. Let's Encrypt)
|
|
ssl_certificate /etc/letsencrypt/live/analytics.degelas.be/fullchain.pem;
|
|
ssl_certificate_key /etc/letsencrypt/live/analytics.degelas.be/privkey.pem;
|
|
|
|
# Adjust to taste / security policy
|
|
ssl_protocols TLSv1.2 TLSv1.3;
|
|
ssl_prefer_server_ciphers on;
|
|
|
|
# Optional: restrict dashboard access by IP/VPN
|
|
# allow 203.0.113.0/24;
|
|
# deny all;
|
|
|
|
location / {
|
|
proxy_pass http://127.0.0.1:3000;
|
|
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;
|
|
}
|
|
}
|
|
|