An optimized Nginx virtual host configuration for Craft CMS implementing security, performance, and SEO best practices.
nginx-craft is a pre-configured Nginx virtual host template optimized for Craft CMS deployments. It solves the problem of manually configuring Nginx for production by providing a secure, performant setup that implements modern web standards, security headers, and SEO best practices. The configuration handles HTTPS enforcement, canonical redirects, static file optimization, and Craft-specific PHP settings.
Developers and system administrators deploying Craft CMS websites on Nginx servers, particularly those managing production environments who want a secure and optimized baseline configuration.
Developers choose nginx-craft because it provides a battle-tested, production-ready configuration that eliminates common setup errors and ensures best practices are followed from the start. Its Craft-specific optimizations and security defaults save significant time compared to building a configuration from scratch.
An Nginx virtual host configuration for Craft CMS that implements a number of best-practices.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Enforces HTTPS redirects, adds XSS protection headers, and disables insecure TLS versions like TLSv1.0, following a 'secure by default' approach to mitigate common vulnerabilities.
Includes far-future expires headers, gzip static file serving, and filename-based cache busting to improve load times and reduce server load for static resources.
Properly sets PATH_INFO and HTTP_HOST environment variables, which are critical for Craft CMS to function correctly and avoid security issues, as noted in the README.
Supports HTTP/2 and IPv6 out of the box with optimized SSL cipher suites, ensuring compatibility with current web standards and better performance.
Assumes Let's Encrypt certificates, Ubuntu paths, and PHP 7.1 via php-fpm, requiring manual adjustments for different setups, which can lead to errors if not carefully reviewed.
The comprehensive configuration includes many production optimizations that might be overkill for small-scale projects or rapid prototyping, adding unnecessary complexity.
Tightly coupled with Craft CMS and specific server setups, making it less adaptable for projects using other frameworks or requiring custom Nginx modules not covered.