Page 1 of 1

Magento 1.9.2 NGINX Config with SSL Enabled

Posted: Fri Jul 27, 2018 10:32 am
by alikamran
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:

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
}
}

Re: Magento 1.9.2 NGINX Config with SSL Enabled

Posted: Sat Jul 28, 2018 6:53 am
by mehargags
You just put SSL thru the regular web user interface and then apply any custom config in the apache/nginx.ssl.conf, though you really should have a template defined for your site if you need to customize it.

Re: Magento 1.9.2 NGINX Config with SSL Enabled

Posted: Sat Jul 28, 2018 10:13 am
by alikamran
mehargags wrote:
Sat Jul 28, 2018 6:53 am
You just put SSL thru the regular web user interface and then apply any custom config in the apache/nginx.ssl.conf, though you really should have a template defined for your site if you need to customize it.
Hi,
Thank you for the reply. If it is not too much trouble can you give me sample config to use for SSL or what should I add in the server block in the current config I am using?

Also what do you mean by a web template?

Re: Magento 1.9.2 NGINX Config with SSL Enabled

Posted: Wed Aug 01, 2018 8:43 pm
by mehargags
The template thing is much discussed in detail, you need to read a few old threads yourself.
Just use wordpress 2 template for Magento 1.9.x and add SSL from the WebUI. it is so simple.

If you still need help, PM me your VestaCP and Server's SSH, I'll fix this for you

Re: Magento 1.9.2 NGINX Config with SSL Enabled

Posted: Thu Aug 09, 2018 12:26 pm
by alikamran
mehargags wrote:
Wed Aug 01, 2018 8:43 pm
The template thing is much discussed in detail, you need to read a few old threads yourself.
Just use wordpress 2 template for Magento 1.9.x and add SSL from the WebUI. it is so simple.

If you still need help, PM me your VestaCP and Server's SSH, I'll fix this for you
Thank you for the update. Ill try and let you know if I need any help. Thank you.