Tomato6966 / Musicium

An advanced Discord Music Bot with a Dashboard, using distube.js.org having an interactive button & menu system and many features! Supported Features: Spotify • YouTube • SoundCloud • Live Stream • Audio Filtering • DJ Roles • Autoplay • Autoresume • Dashboard + Live Queue • ...
https://musicium.eu
GNU General Public License v2.0
299 stars 310 forks source link

SSL HTTPS Support - Proxy / HTTPS #135

Closed Donrskbb closed 2 years ago

Donrskbb commented 2 years ago

How do i make the bot website HTTPS ready?

aniq12 commented 2 years ago

How do i make the bot website HTTPS ready?

tomato already make the video how to do that

Tomato6966 commented 2 years ago

You can either check my video:

Musicium-VPS related: https://www.youtube.com/watch?v=yPBo2Gbp9VY General Websites with standalone webserver: https://www.youtube.com/watch?v=mhYLoP9ncXA&t=157s

or use a proxy manager such as "nginx"

here is MY config:

nano /etc/nginx/sites-enabled/reverse-proxy.conf
server {
    listen 80;
        listen [::]:80 ipv6only=on;
    server_name your.domain.com *.your.domain.com; 
    return 301 https://your.domain.com$request_uri;
}
server {
    server_name your.domain.com;
    location / {
        proxy_pass http://localhost:3001;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
    }
    listen 443 ssl;
        listen [::]:443 ssl;
    ssl_certificate /etc/letsencrypt/live/your.domain.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/your.domain.com/privkey.pem; 
    include /etc/letsencrypt/options-ssl-nginx.conf; 
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
}

To install a CERTBOT SSL for NGINX run these:

apt-get install python3-certbot-nginx 

certbot --nginx -d your.domain.com

Make sure to install the ssl certificiates using CERTBOT SSL first before setting up the nginx server:

apt-get install nginx
apt-get install python3-certbot-nginx
certbot --nginx -d your.domain.com
nano /etc/nginx/sites-enabled/reverse-proxy.conf # fill in the details
systemctl start nginx