ZizzyDizzyMC / linx-server

Self-hosted file/code/media sharing website. ~~~~~~~~~~~~~~~~~~~ Powers https://put.icu
GNU General Public License v3.0
211 stars 34 forks source link

ssl #8

Open rafalohaki opened 3 years ago

rafalohaki commented 3 years ago

open sssl.crt: no such file or directory launch via docker...

ZizzyDizzyMC commented 3 years ago

I've been away from the project for a bit working on IRL things, I will come back and attempt to resolve this when possible.

luckman212 commented 2 years ago

Anyone figure out a way? can we use nginx in front and proxy to backend?

ZizzyDizzyMC commented 2 years ago

You can definitely use nginx to proxy linx-server.

This is a default config that'll work with most installations, change your values to be your own:

server {
                listen 80;
                listen 443 ssl;
                server_name www.domain.tld;
                ssl_certificate /etc/letsencrypt/live/domain.tld/fullchain.pem;
                ssl_certificate_key /etc/letsencrypt/live/domain.tld/privkey.pem;
                location /.well-known/ {
                        root /var/www/html;
                }
                location / {
                        return 301 https://domain.tld$request_uri;
                }
}

server {
        listen 80;
        server_name domain.tld;
        location /.well-known/ {
                root /var/www/html;
        }
        location / {
                        return 301 https://$server_name$request_uri;
        }
}
server {
                listen 443 ssl;
                server_name domain.tld;
                ssl_certificate /etc/letsencrypt/live/domain.tld/fullchain.pem;
                ssl_certificate_key /etc/letsencrypt/live/domain.tld/privkey.pem;
                location / {
                                client_max_body_size 3072M;
                                proxy_pass_header Content-Type;
                                proxy_pass http://127.0.0.1:8080;
                                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                                proxy_set_header Host $http_host;
                }
}

To use, comment out the SSL from the first block and set up your cert with certbot. Once certbot confirms the cert's in place, add back in ssl and the final block with ssl. proxy_pass is whatever ip:port you have linx-server running on, either locally or elsewhere.

luckman212 commented 2 years ago

Good stuff - I got it working!