Magento 2 Nginx Config for SSL termination & Varnish
by Danila Vershinin, , revisited on
GetPageSpeed keeps NGINX and Varnish servers fast and secure: performance modules and builds, plus security fixes within days, all through routine
Free to install; commercial production use requires a subscription.
dnf, yum or apt upgrades. It maintains the largest RPM repository of NGINX module packages and Varnish VMODs, with APT packages for Debian and Ubuntu.
Free to install; commercial production use requires a subscription.
This configuration fixes some errors in the NGINX configuration for Varnish that is shipped by Magento 2 team.
To use it, place the file into /etc/nginx/sites-available/ and make sure to replace example.com with your own store domain.
Requirements
- NGINX security headers module
- Varnish installed on the same machine and listening on port 80
Take note of suggestions specified as comments in the file and make the appropriate action.