Copy security and caching headers into an existing Nginx setup without researching each setting from scratch
Use the repository as a starter config when setting up a new web server for a website or web app
Enable cross-origin font loading on your Nginx-served site by pulling in the relevant CORS snippet
Requires Nginx 1.8.0 or later, template site files must be manually edited to point at your domain names.
This repository is a collection of Nginx configuration files assembled by the HTML5 Boilerplate project. Nginx is a widely used web server, and configuring it well involves a lot of small decisions about performance, security, caching, and file handling. This project packages up those decisions into ready-to-use config snippets so developers do not have to figure them out from scratch. The configs cover things like setting correct content types for different file formats, adding cache expiry headers, allowing fonts to load across domains, protecting system files from being served publicly, and other settings that improve how a website performs and behaves for visitors. The repository is organized around a main Nginx config file, a directory of server definitions (one per site), a directory of reusable config snippets, a custom configs directory, and a mime.types file that maps file extensions to their correct content types. The h5bp directory contains the core snippets, including a basic.conf file that loads a recommended minimum set of rules and a location directory with additional per-route directives. You can use this project in two ways. As a reference, you browse the files and copy the relevant parts into your existing Nginx setup. As a direct replacement, you clone the repository into your server's Nginx config directory and adjust the template files to point at your actual domain names. Site files are enabled or disabled by adding or removing a dot prefix from the filename, which controls whether Nginx loads them automatically. The project requires Nginx version 1.8.0 or later and is available under the MIT license.
← h5bp on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.