toggle menu

Issues with SSL integration on DigitalOcean Server

Dhananjay Kumar |27 Mar at 01:03

I have purchased ssl from ipower and getting certificate and prive key, but as per the suggestion we have changed in /etc/nginx/site-enable in defualt page the below things :

server {

    listen 80;
    listen [::]:80;
      
    listen 443 ssl;
    listen [::]:443;
   
    root /var/www/abc.com;

    index index.php index.html index.htm index.nginx-debian.html;

    server_name abc.com www.abc.com;
   
    ssl_certificate /etc/nginx/ssl/abc.com.crt;
    ssl_certificate_key /etc/nginx/ssl/abc.com.key;
   

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

    location = /favicon.ico { log_not_found off; access_log off; }
    location = /robots.txt { log_not_found off; access_log off; allow all; }
    location ~*  \.(jpg|jpeg|png|gif|ico|css|js)$ {
        expires 365d;
    }
   
    location ~*  \.(pdf)$ {
        expires 30d;
    }
   
    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/run/php/php7.0-fpm.sock;
    }
    location ~ /\.ht {
        deny all;
    }   

}

 

Please any one hepl with the steps for setup ssl on digital ocean.

  • 1 like
  • 2 comments

Rajesh Kumar28 Mar at 04:03

I have reviewed your server configer script, it seems it configured very well. there may be issue with the .crt and .key files of content format.
i have getting the same issues with ssl integration on digital ocean sever in nginx.

i was just added new line in below format:

------BEGIN CERTIFICATE-----
XXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXX
-----END CERTIFICATE-----

i was getting such issues with the simply copy and paste certificate and key inside the files. After formatting like above then its work.

Please once try

Dhananjay Kumar28 Mar at 06:03

Thanks for the suggestion, we have done the same way and it's working.
Really thanks for your support..

Posted:

27 Mar at 01:03

Viewed:

1311 times

Active:

31 Mar at 07:03