Apache in itself is big and consume too much memory and resources. Ningx web server on the other hand doesn’t consume resources as Apache and somewhat less resource crazy. Running Magento powered eCommerce on nginx have several speed specific advantages but configuring ngnix for Magento is not as easy as configuring Magento on Apache.
Believe me or not but Magento is a resource hungry application and when the traffic or bot comes, it puts immense load on Apache server (running on low RAM), in such scenarios all you can do is to restart your Apache to resume normal operation. Fortunately, ngnix will save you from restarting the server every time the load is too high. In the following configuration i am making sure that your Magento installation runs fine on http and https both. Now, lets add SSL support in your nginx.conf file