Bobcares

Bitnami WordPress Nginx SSL | How to setup?

by | Sep 22, 2022

Let’s check on how to enable an HTTPS secure server on WordPress with NGINX and SSL Certified by Bitnami with the assistance of our WordPress Support Service at Bobcares.

WordPress Nginx SSL packaged by Bitnami

 

To have a one-click install solution for WordPress with NGINX and SSL, the WordPress with NGINX and SSL packaged by Bitnami provides you with the best result. Indeed WordPress with NGINX and SSL combines the most popular blogging application with the ability of the NGINX web server.

Bitnami WordPress Nginx SSL

SSL Installation on Bitnami WordPress NGINX

 

Bitnami has brought many structural changes to its stacks. The Bitnami WordPress Nginx SSL will make your website more secure Boost SEO and enhance the user experience, and much more.

 

Install an SSL certificate for your Bitnami Nginx WordPress.

 

You can configure the Let’s Encrypt SSL certificate to Bitnami NGINX WordPress for free, for this you have to set the domain name for your WordPress website.

 

Generate SSL for your Domain

 

To generate Secure Sockets Layer (SSL) first you have to get in with root permission:

$ sudo -i
 

Now stop the Nginx server for WordPress application:

# sudo /opt/bitnami/ctlscript.sh stop nginx
 

Next, install the lego into the stack and then further generate an SSL certificate for the WordPress website. Follow the below command to execute one by one.

 
#cd /tmp
#curl -Ls https://api.github.com/repos/xenolf/lego/releases/latest | grep browser_download_url | grep linux_amd64 | cut -d '"' -f 4 | wget -i -
#ls
 

Now, after checking ls, the latest version of lego will display as below:

 
lego_vX.Y.Z_linux_amd64.tar.gz
 

Next, you have to copy the file version name and execute the below command to install the latest version of lego one by one.

 
tar xf lego_vX.Y.Z_linux_amd64.tar.gz
sudo mkdir -p /opt/bitnami/letsencrypt
sudo mv lego /opt/bitnami/letsencrypt/lego
 

The lego into the Bitnami stack have installed, now It’s time to install an SSL certificate to the website.

 
sudo /opt/bitnami/ctlscript.sh stop nginx
 

Now create a new renewable SSL certificate for the website by performing the command:

 
sudo /opt/bitnami/letsencrypt/lego --tls --email="emailaddress " --domains="domainname" --domains="www.domainname" --path="/opt/bitnami/letsencrypt" run
 

In the above command, replace your email address and domain name with your own values.

 

Lego will generate an SSL certificate for your blog and you have to configure your blog to serve using this SSL certificate.

 

Start NGINX server of WordPress

 

The Nginx server is turned off during the certificate generation. To turn it on execute the below command for Bitnami NGINX.

 
sudo /opt/bitnami/ctlscript.sh start nginx
 

Configure Bitnami WordPress stack for SSL certificate

 

It’s time to update SSL certificate with the root of the WordPress application, this will enable Nginx to find the certificate and redirect your domain to one preferred URL.

 

To provide a path to the Nginx server, we have to edit Bitnami.conf file of the stack, this will redirect Btnami WordPress redirect from HTTP to HTTPS Nginx.

 
nano /opt/bitnami/nginx/conf/server_blocks/wordpress-https-server-block.conf
 

Once you access the file, you have to edit the .crt and .key line.

ssl_certificate      "/opt/bitnami/letsencrypt/certificates/domainname.crt";
ssl_certificate_key  "/opt/bitnami/letsencrypt/certificates/domainanme.key";
 
#       ssl_certificate      server.crt;
#       ssl_certificate_key  server.key;
 

From the above code change domainname with the www or non-www version of your website. That means Bitnami WordPress will redirect HTTP to HTTPS Nginx. Now we point all traffic to one naked domain and provide a path for the SSL certificate.

 

You have to Comment out the previous SSL certificate file by adding ” # ” before the line. Now SSL certificate have successfully configured on your WordPress website. Save and close the file.

 

Configure WordPress for SSL certificate.

 

Configure WordPress by editing the wp-config.php file:

 
nano /opt/bitnami/wordpress/wp-config.php
 

Replace HTTP with HTTPS for your WordPress domain.as shown:

 
define('WP_SITEURL', 'http://domainname');
define('WP_HOME', 'http://domainname');

replace with 

define('WP_SITEURL', 'https://domianname');
define('WP_HOME', 'https://domainname');
 

Save the changes and the final step is to test and restart NGINX.

nginx -t
 
sudo /opt/bitnami/ctlscript.sh restart nginx
 

Conclusion

To conclude your Bintami WordPress now should run on HTTPS secure server with a Let’s Encrypt SSL certificate on it.

 

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.