build-owntone/etc/nginx/sites-available/01-owntone.conf

44 lines
1.6 KiB
Plaintext

server {
# Not specifying 'http2' in the 'listen' directive configures nginx to respond
# with http/1.1 by default, unless another virtual host on the same [address:]port
# has specified 'http2'.
listen 443 ssl;
server_name owntone;
access_log /var/log/nginx/owntone_access.log;
error_log /var/log/nginx/owntone_error.log;
ssl_certificate /etc/letsencrypt/live/owntone/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/owntone/privkey.pem;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_prefer_server_ciphers off;
location /ws {
proxy_pass http://127.0.0.1:3388/;
proxy_http_version 1.1;
proxy_set_header Host owntone.local;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
location / {
proxy_pass http://127.0.0.1:3389;
proxy_http_version 1.1;
proxy_set_header Host owntone.local;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
# TODO: add config to proxy to our web interface build
# This doesnt work, because it will try the proxy first (order in config file
# doesnt matter). Either use separate location block or try_files?
# root /usr/local/share/owntone-web;
}