server-configs-nginx README

The project's README from github.com/h5bp/server-configs-nginx. As one markdown file: README.md.

Nginx Server Configs

Server CI

Nginx Server Configs is a collection of configuration files that can help your server improve the website's performance and security, while also ensuring that resources are served with the correct content-type and are accessible, if needed, even cross-domain.

Getting Started

Using the Nginx server configs repo directly has a few required steps to be able to work.

Check nginx.conf settings

The first thing to check is that the nginx.conf file contains appropriate values for your specific install.

Most specific variables are:

Nginx test and restart

Repository structure

This repository has the following structure:

./
├── conf.d/
│   ├── default.conf
│   └── templates/
├── h5bp/
│   ├── basic.conf
│   ├── location/
│   └── .../
├── custom.d/
│   └── .../
├── mime.types
└── nginx.conf

Usage

As a reference

To use as reference requires no special installation steps, download/checkout the repository to a convenient location and adapt your existing Nginx configuration incorporating the desired functionality from this repository.

Download the latest release archive.

Directly

To use directly, replace the Nginx config directory with this repository. For example:

nginx -s stop
cd /etc
mv nginx nginx-previous
git clone https://github.com/h5bp/server-configs-nginx.git nginx
# install-specific edits
nginx

Manage sites

cd /etc/nginx/conf.d
nginx -s reload

Support

Contributing

Anyone is welcome to contribute, however, if you decide to get involved, please take a moment to review the guidelines:

Acknowledgements

Nginx Server Configs is only possible thanks to all the awesome contributors!

License

The code is available under the MIT license.

server-configs-nginx (h5bp/server-configs-nginx)

Searching Database…

What is this?A collection of ready-made Nginx server configuration files (by the H5BP project) that improve a website's performance and security, set correct content-types, and handle cross-domain resource access.
Is this a full nginx.conf replacement or just snippets I include?Both: it ships a full repository structure (nginx.conf, mime.types, conf.d, templates) that you can use directly, plus individual h5bp/ config snippets (mixins) you can selectively include, like basic.conf which bundles the recommended always-on rules.
How do I start using these configs?Either reference them by downloading/checking out the repo and copying the rules you need into your existing nginx.conf, or use it directly by replacing your Nginx config directory with this repository entirely.
What version of Nginx do I need?Nginx 1.8.0 or newer.
Do I need to edit the files before they work on my server?Yes — you must check nginx.conf for install-specific values (user, errorlog, pid, accesslog) and, when using the provided templates, copy them into conf.d and replace every example.com occurrence with your actual domain.
How is the repository organized so I can find what I need?conf.d/ holds server definitions, templates/ has copy-ready templates for secure/non-secure hosts, h5bp/ contains reusable config snippets and location/ directives, custom.d/ is for your own custom config, plus top-level mime.types and nginx.conf files.
How do I check my config is valid before applying it?The README documents commands to verify the Nginx config, verify it with a custom file path, and reload Nginx to apply the new config without restarting.
What does basic.conf give me out of the box?It loads a small, recommended subset of the repo's rules that add expires headers, allow cross-domain fonts, and protect system files from web access.
How do I add or remove a site?The README outlines steps for creating a new site, then enabling or disabling it by managing its config file within the sites structure.
Creator
h5bp
Size
0.4 MB
Stars
11.6K
Age
13y
Commits · 90 Days