Skip to content
Grav 2.0 is officially stable. Read the announcement →
Archive

Adding let's Encrypt SSL on Ngnix (@DO)

Started by Muut Archive 10 years ago · 7 replies · 587 views
10 years ago

Hi, I'm having problems installing ssl certificate on my digitalocean vps running grav. I assume I have to add the ssl to my grav server block (not default). So, I think my issue is /etc/nginx/sites-available/grav. Below my /etc/nginx/sites-available/grav where my domain replaced by example:

CSS
server {
    listen 80 default_server;
    listen [::]:80 default_server;
    server_name example.com www.example.com;
    return 301 https://$server_name$request_uri;
    
}
server {

    # SSL configuration

    listen 443 ssl http2 default_server;
    listen [::]:443 ssl http2 default_server;
    include snippets/ssl-example.com.conf;
    include snippets/ssl-params.conf;

    ## Begin - Index 
    # for subfolders, simply adjust the rewrite:
    # to use `/subfolder/index.php`
....

Anyone able to help?

10 years ago

I believe you need something like this within your second server block

TXT
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
10 years ago

running "sudo ngix -t" test results in error from duplicate ssl_certificate if I add those two lines in. :/ The same directive comes from the snippets/ssl-example.com.conf.... hmm

10 years ago

in that case, try removing then snippets

10 years ago

I got it working by removing the "default_server" part but it only works for subdomains for some reason now....

10 years ago

Thanks, I got it running perfect now. Used the same but for 16.04. Thanks for the help Vivalldi!

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1351 9 years ago
Archive · by Muut Archive, 9 years ago
2 935 9 years ago
Archive · by Muut Archive, 9 years ago
2 4062 9 years ago
Archive · by Muut Archive, 9 years ago
1 2948 9 years ago
Archive · by Muut Archive, 9 years ago
3 1119 9 years ago