badaix / snapweb

Web interface for Snapcast

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Snapweb behind reverse proxy

MCHellspawn opened this issue · comments

Wondering if you can help me setup snapweb behind a nginx reverse proxy? I setup the site, used let's encrypt's certbot to redirect it to https but the site shows blank when i load it. Any help would be appreciated.

If it's not hosted on the same machine as the snapserver then you must hard code your snapserver's hostname or IP address in script.js:
let snapcontrol = new SnapControl(window.location.hostname, 1780);

Snapweb is hosted on the server. The reverse proxy is not. Is that the same situation you are talking about?

Thinking that's what you meant i just change that line (saw you had a version of the line commented out and used that, changed the IP), but that didn't work.

Well that was just a guess.
Maybe someone can help you, if you better describe your setup. I don't know what a nginx reverse proxy and https redirecting certbot is.

Nginx is a web server on Linux. You can use it to host websites like apache but you can also use it to proxy to different websites on other servers. This allows you to serve multiple web sites from multiple servers through a single server allowing this to work in a single internet IP scenario (like most home users have). So on my firewall i have forwarded port 80 and 443 to my Nginx web server, then in the nginx config files I setup proxies to the various backend servers i have (Nextcloud, Home Assistant, BitWarden, etc..) That way i can serve them all off port 80 and 443 and not have to use non-standard ports for web sites. Just makes for an easier URL in the browser.
Certbot is just a script that the certificate authority Let'sEncrypt uses to easily setup certificates for SSL. It also alters the Nginx config to redirect calls to port 80 over to the encrypted port 443.

Basically what I am trying to do is serve snapweb out on an SSL encrypted server so i can embed it in an iframe in Home Assistant. My Home Assistant is also served over SSL so it doesn't allow non-SSL content in an iFrame.

Not a snapweb issue