question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Docs Update: nginx.conf for Snapserver

See original GitHub issue

Describe 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:closed
  • Created 2 years ago
  • Comments:16 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
jaedbcommented, Oct 2, 2021

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.

1reaction
jaedbcommented, Sep 18, 2021

Is the thinking here to replace the in-browser settings with settings in mopidy.conf? Or to have defaults populated in mopidy.conf, but the user can overwrite those within the Iris UI?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Creating NGINX Plus and NGINX Configuration Files
Understand the basic elements in an NGINX or NGINX Plus configuration file, including directives and contexts.
Read more >
How to Configure NGINX | Linode
Understand NGINX configuration for HTTP, Server blocks, Location blocks, Reverse proxy, and Load balancers with configuration examples.
Read more >
nginx documentation
Introduction · How nginx processes a request · Server names · Using nginx as HTTP load balancer · Configuring HTTPS servers.
Read more >
Using a custom nginx.conf on GKE | Cloud Endpoints with gRPC
Finally, start the service with the updated Kubernetes configuration file using kubectl . kubectl create -f esp_echo_custom_config_gke ...
Read more >
Managing snap configuration | Snapcraft documentation
Snaps are containerised software packages that are simple to create and install. They auto-update and are safe to run. And because they bundle...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found