Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Craft CMS
  3. Nginx Craft

Nginx Craft

MIT1.0.34

An optimized Nginx virtual host configuration for Craft CMS implementing security, performance, and SEO best practices.

GitHubGitHub
304 stars36 forks0 contributors

What is Nginx Craft?

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.

Target Audience

Developers and system administrators deploying Craft CMS websites on Nginx servers, particularly those managing production environments who want a secure and optimized baseline configuration.

Value Proposition

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.

Overview

An Nginx virtual host configuration for Craft CMS that implements a number of best-practices.

Use Cases

Best For

  • Deploying Craft CMS websites on Nginx servers
  • Implementing security best practices for web applications
  • Optimizing Nginx configuration for performance and SEO
  • Setting up HTTPS with Let's Encrypt certificates
  • Configuring HTTP/2 and modern TLS protocols
  • Creating consistent server configurations across multiple Craft CMS projects

Not Ideal For

  • Projects not built with Craft CMS
  • Teams deploying on Apache or other non-Nginx web servers
  • Local development setups prioritizing minimal configuration over security optimizations
  • Servers with custom PHP-FPM setups or non-standard file paths

Pros & Cons

Pros

Secure Defaults

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.

Performance Optimizations

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.

Craft CMS Compatibility

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.

Modern Protocol Support

Supports HTTP/2 and IPv6 out of the box with optimized SSL cipher suites, ensuring compatibility with current web standards and better performance.

Cons

Assumption-Heavy Configuration

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.

Complex for Simple Needs

The comprehensive configuration includes many production optimizations that might be overkill for small-scale projects or rapid prototyping, adding unnecessary complexity.

Limited Flexibility

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.

Frequently Asked Questions

Quick Stats

Stars304
Forks36
Contributors0
Open Issues3
Last commit3 years ago
CreatedSince 2016

Tags

#devops#web-server#craftcms#ssl-tls#security-headers#performance-optimization#nginx-configuration#craft-cms#nginx#http2#server-configuration

Built With

O
OpenSSL
P
PHP-FPM
L
Let's Encrypt
N
Nginx

Included in

Craft CMS551
Auto-fetched 1 day ago

Related Projects

Craft ScriptsCraft Scripts

Shell scripts to manage database backups, asset backups, file permissions, asset syncing, cache clearing, and database syncing between Craft CMS environments

Stars362
Forks62
Last commit1 year ago
Craft CLICraft CLI

Command line interface for Craft CMS 2.

Stars134
Forks12
Last commit7 years ago
CraftmanCraftman

Craft CMS Manager

Stars124
Forks11
Last commit7 years ago
Craft 3 Multi-environmentCraft 3 Multi-environment

DEPRECATED Efficient and flexible multi-environment config for Craft CMS

Stars72
Forks6
Last commit6 years ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub