Answering here in case others are searching for a solution:
ServerPilot uses Nginx as the public facing web server and proxies the requests to Apache. So, we have to add our SSL configuration to Nginx.
Steps:
Login to the server using SSH
Create a directory to hold the certificate and key files.
cd /home
mkdir -p certs/domain_name
Copy the certificate (.crt) and private (.key) files to this directory. Replace domain_name with your domain name.
Add custom SSL configuration here:
cd /etc/nginx-sp/vhosts.d
nano APP_NAME.ssl.conf
Replace APPNAME with your actual app name (website). Put this inside the file APPNAME.ssl.conf:
###############################################################################
# Install SSL Certificate
###############################################################################
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name
www.DOMAIN.com
DOMAIN.com
;
ssl_certificate /home/certs/domain_name/certificate_file.crt;
ssl_certificate_key /home/certs/domain_name/privatekey_file.key;
root /srv/users/serverpilot/apps/APP_NAME/public;
access_log /srv/users/serverpilot/log/APP_NAME/APP_NAME_nginx.access.log main;
error_log /srv/users/serverpilot/log/APP_NAME/APP_NAME_nginx.error.log;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
include /etc/nginx-sp/vhosts.d/APP_NAME.d/*.nonssl_conf;
include /etc/nginx-sp/vhosts.d/APP_NAME.d/*.conf;
}
As usual, replace APPNAME, domainname, certificatefile and privatekeyfile with your own values.
Restart Nginx
service nginx-sp restart
That’s it. The SSL certificate is installed.
Same question…
@ThatPoorKid You could find a solution? I’ve been reading blogs but i am sort of a noob on this..
Following normal commandline procedures to install SSL into Apache2, you should not have any problems. There’s plenty of online tutorials, even video tutorials, showing how to do that.
I have successfully installed ssl. but when I opened wordpress site, firefox showing “Insecure contents. ssl some unencrypted elements on this website have been blocked” wordpress is totally messed… any idea on this error?
thanks
Hi @beenaoc this not a problem from the SSL certificate, this means your WordPress is calling assets without the https url path. I had the same issue. You can manually check your site for such urls and make the changes or install some plugin that force the WordPress to do so. Sorry if my english isn’t perfect but i am willing to help.
For example: you insert one image with this path http://yoursite.com/image.jpg instead of https://yoursite.com/image.jpg. this apply for all, including js, CSS, etc.
I have select coach plan to deploy ssl. After that I downgrade to free plan and supprise SSL stil work. I can’t understand.
Yes caoquyenis, but what happens when the cert expires?