linx-server icon indicating copy to clipboard operation
linx-server copied to clipboard

ssl

Open rafalohaki opened this issue 3 years ago • 4 comments

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

rafalohaki avatar Aug 04 '21 13:08 rafalohaki

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.

ZizzyDizzyMC avatar Aug 09 '21 21:08 ZizzyDizzyMC

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

luckman212 avatar Oct 08 '21 15:10 luckman212

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.

ZizzyDizzyMC avatar Oct 08 '21 19:10 ZizzyDizzyMC

Good stuff - I got it working!

luckman212 avatar Oct 08 '21 19:10 luckman212