{"id":1411,"date":"2016-10-07T08:08:59","date_gmt":"2016-10-07T08:08:59","guid":{"rendered":"http:\/\/cloudkul.com\/blog\/?p=1411"},"modified":"2017-06-14T11:33:47","modified_gmt":"2017-06-14T11:33:47","slug":"optimize-magento-1-9-with-ssl-nginx-and-varnish-cache","status":"publish","type":"post","link":"https:\/\/cloudkul.com\/blog\/optimize-magento-1-9-with-ssl-nginx-and-varnish-cache\/","title":{"rendered":"Optimize Magento 1.9 with SSL, Nginx and Varnish Cache"},"content":{"rendered":"<p style=\"text-align: justify\">Magento store is slow!<\/p>\n<p style=\"text-align: justify\">Well, if you are running your store over magento framework, you might have the very same issue. The problem resides in the fact that your website isn&#8217;t properly optimized. The point is, that setting up an architecture for your store isn&#8217;t a big deal, tuning it properly is the key to desired performance.<\/p>\n<p style=\"text-align: justify\">Talking about optimization, a website is properly optimized or not depends upon the way the server responds, how data is being fetched and delivered, server&#8217;s load handling capacity, etc. To improve the performance and reduce the load on backend server, a frontend server acting as reverse proxy server can be set-up to perform the caching.<\/p>\n<p style=\"text-align: justify\">Varnish acts as a http accelerator and a reverse proxy caching server. Varnish Cache visits your server once to cache the page, then all future requests for the same page will be served by Varnish Cache. If it doesn\u2019t have a request cached, it will forward the request to your backend and then cache its output.<\/p>\n<p style=\"text-align: justify\">Magento 2.x is fully compatible with Varnish cache and it generates Varnish configuration file which can be applied directly without any changes. Magento 1.x, however, isn&#8217;t fully compatible with Varnish cache. By default, Varnish doesn&#8217;t cache requests with cookies and Magento sends the frontend cookie with every request causing a (near) zero hit-rate for Varnish&#8217;s cache. Magento 1.x uses Turpentine which is a full page cache extension for Magento that works with Varnish.<\/p>\n<p style=\"text-align: justify\">Also, in order to make our store fully secure, SSL should be enabled. In our case, as Varnish runs over HTTP and it doesn&#8217;t understand HTTPS requests, we have to set up Nginx that runs over port 443 (allowing HTTPS requests) and pass the requests to the Varnish server. Then Varnish fetch data from the backend as per requests and also keeps a copy of fetched data in order to deliver it when the same requests are made in future.<\/p>\n<p style=\"text-align: justify\">In addition to this, you might encounter sessions and cookies related issues with Turpentine running along with SSL. I have added some additional files in order to fix this bug.<\/p>\n<p style=\"text-align: justify\">So, our architecture comprises of :<\/p>\n<ul style=\"text-align: justify\">\n<li>Apache acting as a backend server running over port 8080.<\/li>\n<li>Varnish acting as a reverse proxy caching server running over port 6081.<\/li>\n<li>Nginx acting as a frontend server, providing SSL termination, running over port 443.<\/li>\n<\/ul>\n<p style=\"text-align: justify\">Let&#8217;s begin with server installation and configuration.<\/p>\n<p style=\"text-align: justify\">Update and Install LAMP server.<\/p>\n<pre class=\"lang:default decode:true\">sudo su\r\n\r\napt-get update\r\n\r\napt-get install lamp-server^<\/pre>\n<p style=\"text-align: justify\">It will install apache2 server, php 5 and mysql server. Check their version.<\/p>\n<pre class=\"lang:default decode:true\">apache2 -v\r\n\r\nphp -v\r\n\r\nmysql -V<\/pre>\n<p style=\"text-align: justify\">Create Database.<\/p>\n<pre class=\"lang:default decode:true\">mysql -u root -p \r\n\r\nmysql&gt; create database magento;\r\n \r\nmysql&gt; grant all on magento.* to 'magento'@'%' identified by 'magento';\r\n\r\nmysql&gt; flush privileges;\r\n\r\nmysql&gt; exit\r\n<\/pre>\n<p style=\"text-align: justify\">Install necessary PHP extensions.<\/p>\n<pre class=\"lang:default decode:true\">apt-get install libcurl3 php5-curl php5-gd php5-mcrypt\r\n\r\nphp5enmod mcrypt<\/pre>\n<p style=\"text-align: justify\">For Magento to work properly, adjust PHP memory limit as,<\/p>\n<pre class=\"lang:default decode:true\">nano \/etc\/php5\/apache2\/php.ini<\/pre>\n<p style=\"text-align: justify\">Change<\/p>\n<pre class=\"lang:default decode:true\">memory_limit = 128M<\/pre>\n<p style=\"text-align: justify\">To<\/p>\n<pre class=\"lang:default decode:true\">memory_limit = 512M<\/pre>\n<p style=\"text-align: justify\">Now, Install magento, unzip the file and move folder to \/var\/www\/ directory.<\/p>\n<p style=\"text-align: justify\">Setup Virtual Host.<\/p>\n<pre class=\"lang:default decode:true\">nano \/etc\/apache2\/sites-enabled\/000-default.conf<\/pre>\n<pre class=\"lang:default decode:true\">&lt;VirtualHost *:80&gt;\r\n    \r\n    ServerName magento.example.com\r\n    DocumentRoot \/var\/www\/magento\r\n    \r\n    &lt;Directory \/var\/www\/magento\/&gt;\r\n        Options Indexes FollowSymLinks MultiViews\r\n        AllowOverride All\r\n        Require all granted\r\n    &lt;\/Directory&gt;\r\n\r\n        ErrorLog ${APACHE_LOG_DIR}\/error.log\r\n        CustomLog ${APACHE_LOG_DIR}\/access.log combined\r\n\r\n&lt;\/VirtualHost&gt;\r\n<\/pre>\n<p style=\"text-align: justify\">Enable rewrite module.<\/p>\n<pre class=\"lang:default decode:true\">a2enmod rewrite\r\n\r\nservice apache2 restart<\/pre>\n<p style=\"text-align: justify\">Change ownerships.<\/p>\n<pre class=\"lang:default decode:true\">sudo chown -R www-data:www-data \/var\/www\/magento\/<\/pre>\n<p style=\"text-align: justify\">Create the host entry.<\/p>\n<pre class=\"lang:default decode:true\">nano \/etc\/hosts<\/pre>\n<p style=\"text-align: justify\">Add,<\/p>\n<pre class=\"lang:default decode:true\">127.0.0.1 magento.example.com<\/pre>\n<p style=\"text-align: justify\">Now hit the URL http:\/\/magento.example.com, and configure Magento.<\/p>\n<p style=\"text-align: justify\">Now, for reverse proxy caching, install Varnish server.<\/p>\n<pre class=\"lang:default decode:true\">apt-get install varnish<\/pre>\n<p style=\"text-align: justify\">check the varnish version.<\/p>\n<pre class=\"lang:default decode:true\">varnishd -V<\/pre>\n<p style=\"text-align: justify\">configure varnish.<\/p>\n<pre class=\"lang:default decode:true\">nano \/etc\/default\/varnish<\/pre>\n<p style=\"text-align: justify\">and do the following settings for varnish 3.x.<\/p>\n<pre class=\"lang:default decode:true\">DAEMON_OPTS=\"-p esi_syntax=0x2 \\\r\n -p cli_buffer=16384 \\\r\n -a :6081 \\\r\n -T localhost:6082 \\\r\n -f \/etc\/varnish\/default.vcl \\\r\n -S \/etc\/varnish\/secret \\\r\n -s malloc,256m\"<\/pre>\n<p style=\"text-align: justify\">To make Magento 1.9 work with Varnish cache, install a magento extension, Turpentine.<\/p>\n<p style=\"text-align: justify\">Install and configure Turpentine.<\/p>\n<p style=\"text-align: justify\"><a href=\"http:\/\/www.magentocommerce.com\/magento-connect\/turpentine-varnish-cache.html\" rel=\"nofollow\">http:\/\/www.magentocommerce.com\/magento-connect\/turpentine-varnish-cache.html<\/a><\/p>\n<p style=\"text-align: justify\">Sign in with your log in credentials and get the extension key.<\/p>\n<p style=\"text-align: justify\">Go to admin panel and configure the following settings.<\/p>\n<p style=\"text-align: justify\">System &gt; Magento Connect &gt; Magento Connect Manager &gt; admin details Login &gt;<\/p>\n<ul style=\"text-align: justify\">\n<li>Paste extension key to install<\/li>\n<li>Refresh the page by clicking bottom link (Refresh) after installation.<\/li>\n<li>Click Return to admin.<\/li>\n<li>Logout &amp; Re-login.<\/li>\n<\/ul>\n<p style=\"text-align: justify\">Now, Go to,<\/p>\n<p style=\"text-align: justify\">System &gt; Cache Storage Management &gt;<\/p>\n<p style=\"text-align: justify\">Enable following cache.<\/p>\n<ul style=\"text-align: justify\">\n<li>Varnish Pages<\/li>\n<li>Varnish ESI Blocks<\/li>\n<\/ul>\n<p style=\"text-align: justify\">Disable all the other cache.<\/p>\n<p style=\"text-align: justify\">System &gt; Configuration &gt; TURPENTINE &gt; varnish option :<\/p>\n<ul style=\"text-align: justify\">\n<li>Server : Varnish Version -&gt; Auto<\/li>\n<li>Server List : 127.0.0.1:6082<\/li>\n<li>Config File Location : {{root_dir}}\/var\/default.vcl<label for=\"turpentine_varnish_servers_config_file\"><\/label><\/li>\n<li>Custom VCL File Location : {{root_dir}}\/app\/code\/community\/Nexcessnet\/Turpentine\/misc\/custom_include.vcl<\/li>\n<\/ul>\n<p style=\"text-align: justify\">Now,<\/p>\n<pre class=\"lang:default decode:true\">nano \/etc\/varnish\/secret<\/pre>\n<p style=\"text-align: justify\">copy the key and paste it in &#8216;Varnish Authentication Key&#8217; with &#8216;\\n&#8217; in the end.<\/p>\n<pre class=\"lang:default decode:true \">0786bc8a-4607-4079-8961-f093c70fyu7f\\n<\/pre>\n<p style=\"text-align: justify\">And set the rest settings to default settings.<\/p>\n<p style=\"text-align: justify\">Now go to TURPENTINE &gt; Caching Options<\/p>\n<ul style=\"text-align: justify\">\n<li>Backend Host : 127.0.0.1<\/li>\n<li>Backend Port : 8080<\/li>\n<\/ul>\n<p style=\"text-align: justify\">Other setting should be configured as per requirement<br \/>\nSave Configuration.<\/p>\n<p style=\"text-align: justify\">Goto Admin &gt; System &gt; Cache Storage Management.<\/p>\n<p style=\"text-align: justify\">Click on<\/p>\n<ul style=\"text-align: justify\">\n<li>Flush Magento Cache.<\/li>\n<li>Flush Cache Storage.<\/li>\n<li>Apply Varnish Config.<\/li>\n<li>Save Varnish Config.<\/li>\n<\/ul>\n<p style=\"text-align: justify\">Here, Turpentine will generate a VCL file as per our Varnish version. Take backup of default.vcl file and create a symlink of the file generated by Turpentine.<\/p>\n<pre class=\"lang:default decode:true\">mv \/etc\/varnish\/default.vcl \/etc\/varnish\/default.vcl_bkp\r\n\r\nln -s \/var\/www\/magento\/var\/default.vcl \/etc\/varnish\/<\/pre>\n<p style=\"text-align: justify\">Varnish runs over HTTP and it doesn&#8217;t support SSL. To enable SSL, install and configure Nginx in front of the Varnish.<\/p>\n<pre class=\"lang:default decode:true\">apt-get install nginx\r\n\r\nnginx -v<\/pre>\n<p style=\"text-align: justify\">Generate keys and certificate for SSL.<\/p>\n<pre class=\"lang:default decode:true\">sudo mkdir \/etc\/nginx\/ssl\r\n\r\nsudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout \/etc\/ssl\/private\/magento.key -out \/etc\/ssl\/certs\/magento.crt<\/pre>\n<p style=\"text-align: justify\">Now do the following settings.<\/p>\n<pre class=\"lang:default decode:true\">Country Name (2 letter code) [AU]:\r\nState or Province Name (full name) [Some-State]:\r\nLocality Name (eg, city) []:\r\nOrganization Name (eg, company) [Internet Widgits Pty Ltd]:\r\nOrganizational Unit Name (eg, section) []:\r\nCommon Name (e.g. server FQDN or YOUR name) []: magento.example.com\r\nEmail Address []:<\/pre>\n<p style=\"text-align: justify\">Change the ports as,<\/p>\n<pre class=\"lang:default decode:true\">nano \/etc\/apache2\/ports.conf\r\n<\/pre>\n<p style=\"text-align: justify\">and edit the file as,<\/p>\n<pre class=\"lang:default decode:true\">#Listen 80\r\nListen 8080\r\n&lt;IfModule ssl_module&gt;\r\n        Listen 443\r\n&lt;\/IfModule&gt;\r\n\r\n&lt;IfModule mod_gnutls.c&gt;\r\n        Listen 443\r\n&lt;\/IfModule&gt;\r\n\r\n<\/pre>\n<p style=\"text-align: justify\">Change listening ports in backend server configuration file as,<\/p>\n<pre class=\"lang:default decode:true\">&lt;VirtualHost *:8080&gt;\r\n ..   \r\n ..\r\n ..\r\n&lt;\/VirtualHost&gt;<\/pre>\n<p style=\"text-align: justify\">Now, configure Nginx for enabling SSL.<\/p>\n<pre class=\"lang:default decode:true\">server {\r\n        listen 80 default_server;\r\n        #listen [::]:80 default_server ipv6only=on;\r\n        server_name magento.example.com;\r\n        return 301 https:\/\/$server_name$request_uri;\r\n}\r\nserver {\r\n        listen 443;\r\n        server_name magento.example.com;\r\n        ssl on;\r\n        ssl_certificate \/etc\/ssl\/certs\/magento.crt;\r\n        ssl_certificate_key \/etc\/ssl\/private\/magento.key;\r\n        ssl_session_timeout 5m;\r\n        ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;\r\n        #ssl_ciphers \"HIGH:!aNULL:!MD5 or HIGH:!aNULL:!MD5:!3DES\";\r\n        ssl_ciphers  ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;\r\n        ssl_prefer_server_ciphers on;\r\n\r\n        location \/ {\r\n             proxy_pass http:\/\/127.0.0.1:6081;\r\n             include \/etc\/nginx\/proxy_params;\r\n             add_header Ssl_Offloaded 1;\r\n#             proxy_set_header Access-Control-Allow-Origin \"*\";\r\n        }\r\n        location ~* \\.(jpg|jpeg|gif|png|css|js|ico|xml|woff2)$ {\r\n            root \/var\/www\/magento;\r\n             access_log        off;\r\n             log_not_found     off;\r\n             expires           360d;\r\n        }\r\nlocation ~ \/\\.ht {\r\n               deny all;\r\n        }\r\n}\r\n<\/pre>\n<p style=\"text-align: justify\">Check Nginx configuration.<\/p>\n<pre class=\"lang:default decode:true \">nginx -t<\/pre>\n<p style=\"text-align: justify\">Setup the proxy parameters.<\/p>\n<pre class=\"lang:default decode:true \">nano \/etc\/nginx\/proxy_parameters<\/pre>\n<pre class=\"lang:default decode:true\">client_max_body_size 100M;\r\nclient_body_buffer_size 1m;\r\nproxy_intercept_errors on;\r\nproxy_buffering on;\r\nproxy_buffer_size 128k;\r\nproxy_buffers 256 16k;\r\nproxy_busy_buffers_size 256k;\r\nproxy_temp_file_write_size 256k;\r\nproxy_max_temp_file_size 0;\r\nproxy_read_timeout 300;\r\n<\/pre>\n<p style=\"text-align: justify\">Adjust apache settings.<\/p>\n<pre class=\"lang:default decode:true\">nano \/etc\/apache2\/apache.conf<\/pre>\n<p style=\"text-align: justify\">Add,<\/p>\n<pre class=\"lang:default decode:true\">SetEnvIf Ssl-Offloaded 1 HTTPS=on<\/pre>\n<p style=\"text-align: justify\">Check Apache configuration.<\/p>\n<pre class=\"lang:default decode:true\">apache2ctl -t<\/pre>\n<p style=\"text-align: justify\">Now go to admin panel, and<\/p>\n<p style=\"text-align: justify\">System &gt; Configuration &gt; Web &gt; Secure &gt;<\/p>\n<p style=\"text-align: justify\">Change the settings as,<\/p>\n<ul style=\"text-align: justify\">\n<li>Base Link URL : https:\/\/magento.example.com\/<\/li>\n<li>Use Secure URLs in Frontend : YES<\/li>\n<li>Use Secure URLs inAdmin : YES<\/li>\n<li>Offloader header : HTTP_SSL_OFFLOADED<label for=\"web_secure_use_in_frontend\"><\/label><label for=\"web_secure_use_in_adminhtml\"><\/label><label for=\"web_secure_offloader_header\"><\/label><\/li>\n<\/ul>\n<p style=\"text-align: justify\">Now to solve sessions related issues for Turpentine when run over ssl, add the following to magento root directory.<\/p>\n<pre class=\"lang:default decode:true\">mkdir -p \/var\/www\/magento\/app\/code\/community\/SupportDesk\/CartFormKey\/Model\r\n\r\nmkdir \/var\/www\/magento\/app\/code\/community\/SupportDesk\/CartFormKey\/etc<\/pre>\n<pre class=\"lang:default decode:true\"> nano \/var\/www\/magento\/app\/code\/community\/SupportDesk\/CartFormKey\/Model\/Observer.php<\/pre>\n<pre class=\"lang:default decode:true\">&lt;?php\r\n\r\nclass SupportDesk_CartFormKey_Model_Observer\r\n{\r\n    function disableCsrf($observer)\r\n    {\r\n        $events = array(\r\n            'checkout_cart_add',\r\n            'checkout_cart_addgroup',\r\n            'checkout_cart_updatepost',\r\n            'review_product_post',\r\n            'sendfriend_product_sendmail',\r\n            'wishlist_index_add',\r\n            'wishlist_index_update',\r\n            'wishlist_index_cart',\r\n            'wishlist_index_send',\r\n            'catalog_product_compare_add',\r\n        );\r\n        $route = $observer-&gt;getEvent()-&gt;getControllerAction()-&gt;getFullActionName();\r\n\r\n        if (in_array($route, $events)) {\r\n            $key = Mage::getSingleton('core\/session')-&gt;getFormKey();\r\n            Mage::app()-&gt;getRequest()-&gt;setParam('form_key', $key);\r\n        }\r\n    }\r\n}<\/pre>\n<pre class=\"lang:default decode:true\">nano \/var\/www\/magento\/app\/code\/community\/SupportDesk\/CartFormKey\/etc\/config.xml<\/pre>\n<pre class=\"lang:default decode:true\">&lt;?xml version=\"1.0\" ?&gt;\r\n&lt;config&gt;\r\n    &lt;modules&gt;\r\n        &lt;SupportDesk_CartFormKey&gt;\r\n            &lt;version&gt;1.0.0&lt;\/version&gt;\r\n        &lt;\/SupportDesk_CartFormKey&gt;\r\n    &lt;\/modules&gt;\r\n    &lt;global&gt;\r\n        &lt;models&gt;\r\n            &lt;supportdesk_cartformkey&gt;\r\n                &lt;class&gt;SupportDesk_CartFormKey_Model&lt;\/class&gt;\r\n            &lt;\/supportdesk_cartformkey&gt;\r\n        &lt;\/models&gt;\r\n\r\n        &lt;events&gt;\r\n            &lt;controller_action_predispatch&gt;\r\n                &lt;observers&gt;\r\n                    &lt;controller_action_before&gt;\r\n                        &lt;class&gt;supportdesk_cartformkey\/observer&lt;\/class&gt;\r\n                        &lt;method&gt;disableCsrf&lt;\/method&gt;\r\n                    &lt;\/controller_action_before&gt;\r\n                &lt;\/observers&gt;\r\n            &lt;\/controller_action_predispatch&gt;\r\n        &lt;\/events&gt;\r\n    &lt;\/global&gt;\r\n&lt;\/config&gt;<\/pre>\n<pre class=\"lang:default decode:true \">\/var\/www\/magento\/app\/etc\/modules\/SupportDesk_CartFormKey.xml<\/pre>\n<pre class=\"lang:default decode:true\">&lt;?xml version=\"1.0\" ?&gt;\r\n&lt;config&gt;\r\n    &lt;modules&gt;\r\n        &lt;SupportDesk_CartFormKey&gt;\r\n            &lt;active&gt;true&lt;\/active&gt;\r\n            &lt;codePool&gt;community&lt;\/codePool&gt;\r\n        &lt;\/SupportDesk_CartFormKey&gt;\r\n    &lt;\/modules&gt;\r\n&lt;\/config&gt;\r\n<\/pre>\n<p style=\"text-align: justify\">Clear all the sessions and cookies.<\/p>\n<pre class=\"lang:default decode:true \">rm -rf \/var\/www\/magento\/var\/cache\/*\r\n\r\nrm -rf \/var\/www\/magento\/var\/session\/*<\/pre>\n<p style=\"text-align: justify\">Restart apache, nginx and varnish to enable all the settings.<\/p>\n<pre class=\"lang:default decode:true\">service apache2 restart\r\n\r\nservice nginx restart\r\n\r\nservice varnish restart<\/pre>\n<p style=\"text-align: justify\">Hit the URL\u00a0 https:\/\/magento.example.com\/<\/p>\n<p style=\"text-align: justify\">To check cache hits use Varnish tools.<\/p>\n<pre class=\"lang:default decode:true\">varnishhist\r\n\r\nvarnishstat<\/pre>\n<p style=\"text-align: justify\">Also, server response can be seen by,<\/p>\n<pre class=\"lang:default decode:true \">curl -I -k https:\/\/magento.example.com\/<\/pre>\n<p style=\"text-align: justify\">Additionally, to configure Magento with Redis as backend cache, <a href=\"http:\/\/cloudkul.com\/blog\/configure-magento-1-9-x-with-redis-as-backend-cache\/\" target=\"_blank\" rel=\"noopener noreferrer\">CLICK HERE<\/a>.<\/p>\n<p style=\"text-align: justify\"><a href=\"http:\/\/cloudkul.com\/contact\/\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/a><\/p>\n<p style=\"text-align: center\"><a href=\"http:\/\/cloudkul.com\/contact\/\" target=\"_blank\" rel=\"noopener noreferrer\">IN CASE OF ANY\u00a0QUERY, CONTACT US<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Magento store is slow! Well, if you are running your store over magento framework, you <a class=\"text-primary\" title=\"read more\" href=\"https:\/\/cloudkul.com\/blog\/optimize-magento-1-9-with-ssl-nginx-and-varnish-cache\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":7,"featured_media":1484,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[20],"tags":[65,70,71,66,67,69,68],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Optimize Magento 1.9 with SSL, Nginx and Varnish Cache - Cloudkul<\/title>\n<meta name=\"description\" content=\"Talking about optimization, a website is properly optimized or not depends upon the way the server responds, how data is being fetched and delivered, server&#039;s load handling capacity, etc. To improve the performance and reduce the load on backend server, a frontend server acting as reverse proxy server can be set-up to perform the caching.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/cloudkul.com\/blog\/optimize-magento-1-9-with-ssl-nginx-and-varnish-cache\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Optimize Magento 1.9 with SSL, Nginx and Varnish Cache - Cloudkul\" \/>\n<meta property=\"og:description\" content=\"Talking about optimization, a website is properly optimized or not depends upon the way the server responds, how data is being fetched and delivered, server&#039;s load handling capacity, etc. To improve the performance and reduce the load on backend server, a frontend server acting as reverse proxy server can be set-up to perform the caching.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/cloudkul.com\/blog\/optimize-magento-1-9-with-ssl-nginx-and-varnish-cache\/\" \/>\n<meta property=\"og:site_name\" content=\"Cloudkul\" \/>\n<meta property=\"article:published_time\" content=\"2016-10-07T08:08:59+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2017-06-14T11:33:47+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cloudkul.com\/blog\/wp-content\/uploads\/2016\/10\/Optimize-Magento-1.png\" \/>\n\t<meta property=\"og:image:width\" content=\"848\" \/>\n\t<meta property=\"og:image:height\" content=\"422\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Alankrit Srivastava\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/cloudkul.com\/blog\/optimize-magento-1-9-with-ssl-nginx-and-varnish-cache\/\",\"url\":\"https:\/\/cloudkul.com\/blog\/optimize-magento-1-9-with-ssl-nginx-and-varnish-cache\/\",\"name\":\"Optimize Magento 1.9 with SSL, Nginx and Varnish Cache - Cloudkul\",\"isPartOf\":{\"@id\":\"https:\/\/cloudkul.com\/blog\/#website\"},\"datePublished\":\"2016-10-07T08:08:59+00:00\",\"dateModified\":\"2017-06-14T11:33:47+00:00\",\"author\":{\"@id\":\"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/fc06bfd7f18d9a606dd94062d205af16\"},\"description\":\"Talking about optimization, a website is properly optimized or not depends upon the way the server responds, how data is being fetched and delivered, server's load handling capacity, etc. To improve the performance and reduce the load on backend server, a frontend server acting as reverse proxy server can be set-up to perform the caching.\",\"breadcrumb\":{\"@id\":\"https:\/\/cloudkul.com\/blog\/optimize-magento-1-9-with-ssl-nginx-and-varnish-cache\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/cloudkul.com\/blog\/optimize-magento-1-9-with-ssl-nginx-and-varnish-cache\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/cloudkul.com\/blog\/optimize-magento-1-9-with-ssl-nginx-and-varnish-cache\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/cloudkul.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Optimize Magento 1.9 with SSL, Nginx and Varnish Cache\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/cloudkul.com\/blog\/#website\",\"url\":\"https:\/\/cloudkul.com\/blog\/\",\"name\":\"Cloudkul\",\"description\":\"Host your eCommerce Store on AWS with Optimized Performance\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/cloudkul.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/fc06bfd7f18d9a606dd94062d205af16\",\"name\":\"Alankrit Srivastava\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/955c3dda2678272c436c5153832e401f?s=96&d=https%3A%2F%2Fs.gravatar.com%2Favatar%2F6148c37469011bc2f8e491ca8f5de495%3Fs%3D80&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/955c3dda2678272c436c5153832e401f?s=96&d=https%3A%2F%2Fs.gravatar.com%2Favatar%2F6148c37469011bc2f8e491ca8f5de495%3Fs%3D80&r=g\",\"caption\":\"Alankrit Srivastava\"},\"description\":\"DevOps Manager at Webkul Software Privated Limited\",\"sameAs\":[\"http:\/\/cloudkul.com\"],\"url\":\"https:\/\/cloudkul.com\/blog\/author\/alankrit-srivastava256\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Optimize Magento 1.9 with SSL, Nginx and Varnish Cache - Cloudkul","description":"Talking about optimization, a website is properly optimized or not depends upon the way the server responds, how data is being fetched and delivered, server's load handling capacity, etc. To improve the performance and reduce the load on backend server, a frontend server acting as reverse proxy server can be set-up to perform the caching.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/cloudkul.com\/blog\/optimize-magento-1-9-with-ssl-nginx-and-varnish-cache\/","og_locale":"en_US","og_type":"article","og_title":"Optimize Magento 1.9 with SSL, Nginx and Varnish Cache - Cloudkul","og_description":"Talking about optimization, a website is properly optimized or not depends upon the way the server responds, how data is being fetched and delivered, server's load handling capacity, etc. To improve the performance and reduce the load on backend server, a frontend server acting as reverse proxy server can be set-up to perform the caching.","og_url":"https:\/\/cloudkul.com\/blog\/optimize-magento-1-9-with-ssl-nginx-and-varnish-cache\/","og_site_name":"Cloudkul","article_published_time":"2016-10-07T08:08:59+00:00","article_modified_time":"2017-06-14T11:33:47+00:00","og_image":[{"width":848,"height":422,"url":"https:\/\/cloudkul.com\/blog\/wp-content\/uploads\/2016\/10\/Optimize-Magento-1.png","type":"image\/png"}],"author":"Alankrit Srivastava","twitter_card":"summary_large_image","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/cloudkul.com\/blog\/optimize-magento-1-9-with-ssl-nginx-and-varnish-cache\/","url":"https:\/\/cloudkul.com\/blog\/optimize-magento-1-9-with-ssl-nginx-and-varnish-cache\/","name":"Optimize Magento 1.9 with SSL, Nginx and Varnish Cache - Cloudkul","isPartOf":{"@id":"https:\/\/cloudkul.com\/blog\/#website"},"datePublished":"2016-10-07T08:08:59+00:00","dateModified":"2017-06-14T11:33:47+00:00","author":{"@id":"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/fc06bfd7f18d9a606dd94062d205af16"},"description":"Talking about optimization, a website is properly optimized or not depends upon the way the server responds, how data is being fetched and delivered, server's load handling capacity, etc. To improve the performance and reduce the load on backend server, a frontend server acting as reverse proxy server can be set-up to perform the caching.","breadcrumb":{"@id":"https:\/\/cloudkul.com\/blog\/optimize-magento-1-9-with-ssl-nginx-and-varnish-cache\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/cloudkul.com\/blog\/optimize-magento-1-9-with-ssl-nginx-and-varnish-cache\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/cloudkul.com\/blog\/optimize-magento-1-9-with-ssl-nginx-and-varnish-cache\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/cloudkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Optimize Magento 1.9 with SSL, Nginx and Varnish Cache"}]},{"@type":"WebSite","@id":"https:\/\/cloudkul.com\/blog\/#website","url":"https:\/\/cloudkul.com\/blog\/","name":"Cloudkul","description":"Host your eCommerce Store on AWS with Optimized Performance","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/cloudkul.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/fc06bfd7f18d9a606dd94062d205af16","name":"Alankrit Srivastava","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/955c3dda2678272c436c5153832e401f?s=96&d=https%3A%2F%2Fs.gravatar.com%2Favatar%2F6148c37469011bc2f8e491ca8f5de495%3Fs%3D80&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/955c3dda2678272c436c5153832e401f?s=96&d=https%3A%2F%2Fs.gravatar.com%2Favatar%2F6148c37469011bc2f8e491ca8f5de495%3Fs%3D80&r=g","caption":"Alankrit Srivastava"},"description":"DevOps Manager at Webkul Software Privated Limited","sameAs":["http:\/\/cloudkul.com"],"url":"https:\/\/cloudkul.com\/blog\/author\/alankrit-srivastava256\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/posts\/1411"}],"collection":[{"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/comments?post=1411"}],"version-history":[{"count":45,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/posts\/1411\/revisions"}],"predecessor-version":[{"id":2880,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/posts\/1411\/revisions\/2880"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/media\/1484"}],"wp:attachment":[{"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/media?parent=1411"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/categories?post=1411"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/tags?post=1411"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}