Docs Update: nginx.conf for Snapserver
See original GitHub issueDescribe the bug
I have a system nginx reverse proxy, and used the nginx-conf example from the wiki
When I open https://iris.local.my.tld/
, everything works except the Snapserver connection. When I try to enter the IP, I get:
WebSocket connection to 'wss://192.168.40.17:1780/jsonrpc' failed: Error in connection establishment: net::ERR_CONNECTION_RESET
As you can see, it tries to connect via wss
, which is obvisioully wrong for IP-based. If I use the domain name https://iris.local.my.tld/
, it doesn’t work either.
I assume it is because the sample nginx conf only forwards to port 6680, not 1780.
To work around this, I created the following separate nginx conf:
server {
listen 80;
# Set to "_" to listen to all domains
server_name snapserver.local.mytld.com
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
# Set to "_" to listen to all domains
server_name snapserver.local.mytld.com;
# Update the following to reflect your certificate and key location
ssl on;
ssl_certificate /etc/nginx/ssl/wildcard.local.mytld.com.fullchain;
ssl_certificate_key /etc/nginx/ssl/wildcard.local.mytld.com.key;
ssl_prefer_server_ciphers on;
proxy_http_version 1.1;
proxy_read_timeout 600s;
location / {
proxy_pass http://127.0.0.1:1780;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
}
}
I did not test this, but it should be possible to combine this with the iris.conf, e.g. simply add a subdirectory:
location /snapserver {
proxy_pass http://127.0.0.1:1780;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
}
Afterwards, I added snapserver.local.mytld.com
and port 443
in iris server settings and the connection worked.
Took me a while to figure out. Perhaps this could be added to the documentation?
Issue Analytics
- State:
- Created 2 years ago
- Comments:16 (10 by maintainers)
You can now set default Snapcast configuration in
mopidy.conf
. Clients can restore defaults to apply these, but they’re not applied initially. For this, the URL-based preconfiguration approach is more suited. This approach does need a bit more reviewing which is in the pipeline.Is the thinking here to replace the in-browser settings with settings in
mopidy.conf
? Or to have defaults populated inmopidy.conf
, but the user can overwrite those within the Iris UI?