Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

noblemfd's avatar

Laravel Deployed Application not secured using certbot

I am using ubuntu-20.04 for Laravel-8 application. When I deployed to the server I ran this:

sudo certbot --nginx -d example.com -d www.example.com

sudo certbot renew --dry-run

After showing success, I still got this on the browser:

Not Secure: Your connection is not private

The folder in sites-available is like this:

server {
    root /var/www/html/myapp;
    index index.html index.htm index.nginx-debian.html;
    server_name example.com;

    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }

    listen [::]:443 ssl ipv6only=on; # managed by Certbot
    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/example.com/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

}
server {
   if ($host = example.com) {
        return 301 https://$host$request_uri;
    } # managed by Certbot

    listen 80;
    listen [::]:80;
    server_name example.com;
    return 404; # managed by Certbot
}

How do I get this resolved?

Thanks

0 likes
2 replies
neilstee's avatar
neilstee
Best Answer
Level 34

@noblemfd try the following:

  • restart your Nginx
  • stop your Nginx and renew the certs again and start Nginx
  • make sure you clear your browser cache
acoustic85's avatar

What about sites-enabled ? do you have configuration file there ?

Please or to participate in this conversation.