Home > Blockchain >  NGINX: I installed SSL Certbot but it still says site not secure
NGINX: I installed SSL Certbot but it still says site not secure

Time:08-24

I installed a certificate SSL certbot to my frontend https://myweb.cl:3000 and it worked ("site is secure").

but then I tried to install SSL in my backend https://myweb.cl:4000

const credent = {
   key: fs.readFileSync('/etc/letsencrypt/live/myweb.cl/privkey.pem'),
   cert: fs.readFileSync('/etc/letsencrypt/live/myweb.cl/cert.pem')
};

const server = https.createServer(credent,app);

but I lost my "padlock" in the frontend, now it says "site Not secure" and I just have it in the backend. Can I use the same cert certbot for both ports? frontend(3000) and backend(4000)? Is strange because my frontend is still httpS.

This is my /etc/nginx/sites-enabled

server {
    listen 80;
    server_name myweb.cl www.myweb.cl;
    location / {
            proxy_pass http://localhost:3000;
            
    }

//all this down here was provided by certbot
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/myweb.cl/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/myweb.cl/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot


}

Help. Thanks in advanceenter image description here

CodePudding user response:

I found the solution, thank you all for your answers

  • Related