44 lines
1.3 KiB
Plaintext
44 lines
1.3 KiB
Plaintext
server {
|
|
listen 80;
|
|
listen [::]:80;
|
|
server_name music.thekims.family;
|
|
|
|
location /.well-known/acme-challenge/ {
|
|
root /var/www/certbot;
|
|
}
|
|
|
|
location / {
|
|
return 301 https://$host$request_uri;
|
|
}
|
|
}
|
|
|
|
server {
|
|
listen 443 ssl;
|
|
listen [::]:443 ssl;
|
|
http2 on;
|
|
server_name music.thekims.family;
|
|
|
|
ssl_certificate /etc/letsencrypt/live/music.thekims.family/fullchain.pem;
|
|
ssl_certificate_key /etc/letsencrypt/live/music.thekims.family/privkey.pem;
|
|
|
|
include /etc/nginx/conf.d/security-headers.inc;
|
|
|
|
# Use a variable so nginx starts even if the upstream is down
|
|
set $upstream_navidrome http://navidrome:4533;
|
|
|
|
location / {
|
|
proxy_pass $upstream_navidrome;
|
|
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;
|
|
|
|
# Navidrome streams scan progress and now-playing state over
|
|
# Server-Sent Events on /api/events. Buffering holds those messages
|
|
# until the response ends (it never does), and HTTP/1.0 to the upstream
|
|
# can't carry the chunked response the stream needs.
|
|
proxy_http_version 1.1;
|
|
proxy_buffering off;
|
|
}
|
|
}
|