ERR_SSL_PROTOCOL_ERROR nginx

My domain is:
sal.reit.lv
I ran this command:
Hello !
I have a docker-compose stack with nginx and certbot running in a separate containers on a remote server.
certificates is shared between services by shared_volume, nginx container can reach certificates, produces no errors (at least error logs if empty), certbot did job certificates in place.
The problem is - website is unreachable on https.

part of nginx config -

server {
    listen 80;
    listen [::]:80;
    server_name sal.reit.lv;

    client_max_body_size 128M;

    location /.well-known/acme-challenge/ {
        root /var/www/html;
    }

    location / {
        return 301 https://$host$request_uri;
    }
}

server {
    listen 443;
    listen [::]:443;
    server_name sal.reit.lv;
    root /application/public;

    client_max_body_size 128M;

    ssl_certificate /etc/letsencrypt/live/sal.reit.lv/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/sal.reit.lv/privkey.pem;

ls -la in nginx container on certs -
root:/etc/letsencrypt/live/sal.reit.lv# ls -la

total 12
drwxr-xr-x 2 root root 4096 Jun  6 16:08 .
drwx------ 3 root root 4096 Jun  6 16:08 ..
-rw-r--r-- 1 root root  692 Jun  6 16:08 README
lrwxrwxrwx 1 root root   35 Jun  6 16:08 cert.pem -> ../../archive/sal.reit.lv/cert1.pem
lrwxrwxrwx 1 root root   36 Jun  6 16:08 chain.pem -> ../../archive/sal.reit.lv/chain1.pem
lrwxrwxrwx 1 root root   40 Jun  6 16:08 fullchain.pem -> ../../archive/sal.reit.lv/fullchain1.pem
lrwxrwxrwx 1 root root   38 Jun  6 16:08 privkey.pem -> ../../archive/sal.reit.lv/privkey1.pem

what could be problem ?

Maybe because you are missing ssl in your listen clauses for port 443

Should be like:

3 Likes

Ye just noticed it. w8 a few minutes untill stack build up ill check and where to hit solve button ?

The bottom of each post has a solution tick box. You generally mark the one that led to the solution

3 Likes

Basically your is a solution. I noticed it basically few moments prior.
Thanks

3 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.