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

noblemfd's avatar

Site not secure in Laravel https Nginx deploy

Using Laravel-5.8, I deployed a site to digital ocean using nginx ubuntu. I used https. Initially everything was working but suddenly I got this error:

Your connection is not private.

The I have to click on Advance

See my sites-available

/etc/nginx/sites-available/myapp.apps.net.conf

server {
        listen 80;
        listen [::]:80;

    server_name myapp.apps.net;
    return 301 https://$server_name$request_uri;
}

server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    server_name myapp.apps.net;
    root /var/www/html/myapp;

    ssl_certificate /etc/letsencrypt/live/myapp.apps.net/fullchain.pem;
        ssl_certificate_key /etc/letsencrypt/live/myapp.apps.net/privkey.pem;

    ssl_protocols TLSv1.2;
        ssl_ciphers ECDHE-RSA-AES256-GCM-SHA512:DHE-RSA-AES256-GCM-SHA512:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384;
        ssl_prefer_server_ciphers on;

        add_header X-Frame-Options "SAMEORIGIN";
        add_header X-XSS-Protection "1; mode=block";
        add_header X-Content-Type-Options "nosniff";

        index index.php index.html index.htm;

    charset utf-8;

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

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
    }



    location ~ /\.ht {
            deny all;
    }

    location ~ /.well-known {
            allow all;
    }
}

See my sites-enabled

/etc/nginx/sites-enabled/myapp.apps.net.conf

    server {
        listen 80;
        listen [::]:80;

    server_name myapp.apps.net;
    return 301 https://$server_name$request_uri;
}

server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    server_name myapp.apps.net;
    root /var/www/html/myapp;

    ssl_certificate /etc/letsencrypt/live/myapp.apps.net/fullchain.pem;
        ssl_certificate_key /etc/letsencrypt/live/myapp.apps.net/privkey.pem;

    ssl_protocols TLSv1.2;
        ssl_ciphers ECDHE-RSA-AES256-GCM-SHA512:DHE-RSA-AES256-GCM-SHA512:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384;
        ssl_prefer_server_ciphers on;

        add_header X-Frame-Options "SAMEORIGIN";
        add_header X-XSS-Protection "1; mode=block";
        add_header X-Content-Type-Options "nosniff";

        index index.php index.html index.htm;

    charset utf-8;

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

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
    }



    location ~ /\.ht {
            deny all;
    }

    location ~ /.well-known {
            allow all;
    }
}

How do I get this resolved?

Thanks

0 likes
1 reply
Snapey's avatar

do you have assets on the page that you have linked with http, for instance, uploaded images

Please or to participate in this conversation.