In this KB
- Connecting to application via SFTP
- Updating certificate file
- Updating private key file
- Restarting Nginx (Web Server)
We have explained in another guide on how you can get and deploy an SSL certificate (assuming you do not have any certificate already) for your application.
If you have previously purchased a certificate, follow the instructions in this guide to deploy it to your application on the Cloudways Platform.
Step 1: Connect to the Application via SFTP
Follow the instructions in this SFTP guide to open an SFTP session to the target application.
If you connect using the application credentials, you are going to land directly into the application folder. Then you just need to enter into the SSL directory.
Alternatively, if you connect using the master credentials, you will need to first enter your target application folder and then into the SSL directory.
Step 2: Update the Certificate File
Once in the SSL folder, right click on the server.crt file and edit it.
Replace the content of the server.crt file with the content of your own certificate file.
Now, copy the intermediate certificates under the certificate you have pasted in the previous step. Make sure to follow this order (application certificate and then intermediate certificates).
Step 3: Update the Private Key File
Right click on the server.key file and edit it.
Replace the content again with the content of your private key (the one you used to generate your certificate).
Step 4: Restart Nginx (Web Server)
- Click on Servers in the top menu bar.
- Choose the server you have deployed your own certificate to.
- Now under the Server Management area, click on the Manage Services section.
- Restart the Nginx service.
That’s it! Your certificate should now be properly installed.