Closed hatcreek68 closed 6 years ago
By far the easiest option is going to be to reverse proxy node with something like Nginx.
apt-get install nginx
Then edit /etc/nginx/sites-enabled/default
with something similar to the following:
server {
listen 80;
listen 443 ssl http2;
server_name patiobar.yourdomain.com;
access_log /var/log/nginx/patiobar.access.log;
ssl_certificate /etc/letsencrypt/live/patiobar/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/patiobar/privkey.pem;
root /home/pi/Patibar;
location / {
proxy_pass http://localhost:3000;
}
location /.well-known {
allow all;
}
}
Then install letsencrypt and make sure the above ssl_certificate*
lines match where letsencrypt put your certificates, and finally restart nginx service nginx restart
thanks for the tip!
Just confirming nginx worked great. Thanks again.
I changed the header to the code below in patiobar/index.js to try and connect via https - and i can get to the new HTTPS site, but it breaks the link to pianobar data and controls.
i get this, w/ dead buttons, no data:
I was trying to merge this example header w/ the patiobar/index.js header. [https example]((https://www.sitepoint.com/how-to-use-ssltls-with-node-js/)