Question

WordPress LEMP with Cloudflare - Can't Use Fully encrypted SSL?

Posted June 16, 2020 186 views
WordPressLEMP

So I was struggling to connect my domain to my droplet.

And I found out that the cause is my SSL Setting in Cloudflare that’s set to “Full”.

After changing it to “Flexible”, my domain now works in DigitalOcean.

But setting it to Flexible causes other errors in my site. Mainly the JavaScript in my theme causes “loading chunk failed” and won’t load.

The theme works just fine in my local LEMP stack.

Is the Full SSL setting is not supported in DigitalOcean or is there any other way?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
2 answers

Hey @hrsetyono ,

Ideally, the ‘Full’ encryption method should be working just fine if the SSL configuration on your web server is fine as well.

Could you answer some quick questions in order for me, to try and give a suggestion:

-How did you link your domain to Cloudflare?(in your domain registrar you added the Cloudflare nameservers, in the CloudFlare dashboard you pointed your domain to your droplet IP?)

-Could you give me your Nginx configuration?(did you configured it to always redirect to 443?)

-What exact errors are you facing? It could be a good idea to check the Nginx logs and see if you can extract something from there as well.

I’ll be waiting for your response and let’s hope we work this out. :)

Best regards,

Hi @denislavgavrilov,

Thank you for your reply.

-How did you link your domain to Cloudflare?(in your domain registrar you added the Cloudflare nameservers, in the CloudFlare dashboard you pointed your domain to your droplet IP?)

I changed my Nameserver to cloudflare to add it. Then I add an A record pointing to the droplet’s IP address

-Could you give me your Nginx configuration?(did you configured it to always redirect to 443?)

I follow the official tutorial for my nginx setup:

The setup is:

server {
  listen 443;
  root /home/myname/wp;
  index index.php index.html index.htm index.nginx-debian.html;
  server_name lab.wptips.dev;

  location / {
    #try_files $uri $uri/ =404;
    try_files $uri $uri/ /index.php$is_args$args;
  }

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

  location ~ /\.ht {
    deny all;
  }

  location = /favicon.ico { log_not_found off; access_log off; }
  location = /robots.txt { log_not_found off; access_log off; allow all; }
  location ~* \.(css|gif|ico|jpeg|jpg|js|png)$ {
    expires max;
    log_not_found off;
  }

}

-What exact errors are you facing? It could be a good idea to check the Nginx logs and see if you can extract something from there as well.

The error is Error 525 - SSL Handshake Failed. Do I still need to install Let’s Encrypt in DigitalOcean? In my old host, I don’t need to install the SSL and simply use the one from Cloudflare

The domain is https://lab.wptips.dev/. I’m on the process of fixing it so the error might not say 525 when you check it.

I can’t find the log in my /etc/nginx folder. Where is this log?

Thanks

by Justin Ellingwood
by Mark Drake
This tutorial details the process for installing and configuring the components that constitute a LEMP stack on an Ubuntu 18.04 server, including Nginx, MySQL, and PHP. It also includes instructions for testing that these components can communicate effectively and serve your content correctly.
  • Hey @hrsetyono ,

    Yes, you need to install Letsencrypt on your droplet and add the path to your certificate to your Nginx configuration. Otherwise, it will not work.

    I recommend installing Certbot+Let’s Encrypt and get a cert with certbot --nginx -d example.com -d www.example.com (Source).

    The logs for your Nginx should be in /var/log/nginx/error.log

    This way, it will most certainly work! :)

    Best regards,

Submit an Answer