Magento 1.9.2 NGINX Config with SSL Enabled
Posted: Fri Jul 27, 2018 10:32 am
Hi,
I have finally decided to enable SSL on my website. But I am not sure how to enable a third party SSL certificate on Vesta and configure the nginx for Magento 1.9.2 to work with it. Following are the details:
CentOS 7
nginx+php-fpm
VestaCP
Comodo InstantSSL
I need guidance on what block should I do to enable SSL and make it work properly with the website? Also what config should I add in snginx.domain.com? Thank you.
Current nginx config:
I have finally decided to enable SSL on my website. But I am not sure how to enable a third party SSL certificate on Vesta and configure the nginx for Magento 1.9.2 to work with it. Following are the details:
CentOS 7
nginx+php-fpm
VestaCP
Comodo InstantSSL
I need guidance on what block should I do to enable SSL and make it work properly with the website? Also what config should I add in snginx.domain.com? Thank you.
Current nginx config:
Code: Select all
server {
listen 80 default;
server_name hidden;
root hidden;
location / {
index index.html index.php;
try_files $uri $uri/ @handler;
expires 30d;
}
location ^~ /app/ { deny all; }
location ^~ /includes/ { deny all; }
location ^~ /lib/ { deny all; }
location ^~ /media/downloadable/ { deny all; }
location ^~ /pkginfo/ { deny all; }
location ^~ /report/config.xml { deny all; }
location ^~ /var/ { deny all; }
location /var/export/ {
auth_basic "Restricted";
auth_basic_user_file htpasswd;
autoindex on;
}
location /. {
return 404;
}
location @handler {
rewrite / /index.php;
}
location ~ .php/ {
rewrite ^(.*.php)/ $1 last;
}
location ~ .php$ {
if (!-e $request_filename) { rewrite / /index.php last; }
expires off;
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param MAGE_RUN_CODE default;
fastcgi_param MAGE_RUN_TYPE store;
include fastcgi_params; ## See /etc/nginx/fastcgi_params
}
}