All Projects → h5bp → Server Configs Nginx

h5bp / Server Configs Nginx

Licence: mit
Nginx HTTP server boilerplate configs

Projects that are alternatives of or similar to Server Configs Nginx

Server Configs Apache
Apache HTTP server boilerplate configs
Stars: ✭ 2,916 (-69.17%)
Mutual labels:  standard, config, best-practices, robust, h5bp
Nginx Admins Handbook
How to improve NGINX performance, security, and other important things.
Stars: ✭ 12,463 (+31.79%)
Mutual labels:  best-practices, nginx, nginx-configuration
Nginxconfig.io
⚙️ NGINX config generator on steroids 💉
Stars: ✭ 14,983 (+58.43%)
Mutual labels:  nginx, nginx-configuration
Production Ready Expressjs Server
Express.js server that implements production-ready error handling and logging following latest best practices.
Stars: ✭ 101 (-98.93%)
Mutual labels:  best-practices, nginx
Html5 Boilerplate
A professional front-end template for building fast, robust, and adaptable web apps or sites.
Stars: ✭ 52,009 (+449.95%)
Mutual labels:  best-practices, robust
nginx-conf
Nginx configuration
Stars: ✭ 18 (-99.81%)
Mutual labels:  config, nginx-configuration
Nginx Tuning
NGINX tuning for best performance
Stars: ✭ 1,900 (-79.91%)
Mutual labels:  best-practices, nginx
Php Conventions
Рекомендации по написанию PHP кода
Stars: ✭ 156 (-98.35%)
Mutual labels:  standard, best-practices
lightning-hydra-template
PyTorch Lightning + Hydra. A very user-friendly template for rapid and reproducible ML experimentation with best practices. ⚡🔥⚡
Stars: ✭ 1,905 (-79.86%)
Mutual labels:  config, best-practices
Write Readable Javascript Code
📖 All about writing maintainable JavaScript
Stars: ✭ 244 (-97.42%)
Mutual labels:  standard, best-practices
Nginx Ui
Nginx UI allows you to access and modify the nginx configurations files without cli.
Stars: ✭ 4,067 (-56.99%)
Mutual labels:  nginx, nginx-configuration
Magento Nginx Config
Default Nginx config for Magento
Stars: ✭ 462 (-95.11%)
Mutual labels:  config, nginx
Docker Cloud Platform
使用Docker构建云平台,Docker云平台系列共三讲,Docker基础、Docker进阶、基于Docker的云平台方案。OpenStack+Docker+RestAPI+OAuth/HMAC+RabbitMQ/ZMQ+OpenResty/HAProxy/Nginx/APIGateway+Bootstrap/AngularJS+Ansible+K8S/Mesos/Marathon构建/探索微服务最佳实践。
Stars: ✭ 86 (-99.09%)
Mutual labels:  nginx
Ngr
A high-performance & enterprise-class edge gateway middleware
Stars: ✭ 89 (-99.06%)
Mutual labels:  nginx
Git Style Guide
A git style guide.
Stars: ✭ 86 (-99.09%)
Mutual labels:  best-practices
Taiga Docker
[NOT MAINTAINED] Taiga project management platform for Docker
Stars: ✭ 85 (-99.1%)
Mutual labels:  nginx
Dockerweb
A docker-powered bash script for shared web hosting management. The ultimate Docker LAMP/LEMP Stack.
Stars: ✭ 89 (-99.06%)
Mutual labels:  nginx
Neatinput
A .NET standard project which aims to make keyboard and mouse input monitoring easy on Windows and eventually Linux.
Stars: ✭ 89 (-99.06%)
Mutual labels:  standard
Docker Laravel
Laravel 5 with Dockerized Gulp, PHP-FPM, MySQL and nginx using docker-compose
Stars: ✭ 85 (-99.1%)
Mutual labels:  nginx
Nginx Prometheus Metrics
A production demo to collect prometheus metrics for nginx with lua embedded.
Stars: ✭ 84 (-99.11%)
Mutual labels:  nginx

Nginx Server Configs

Test

Nginx Server Configs is a collection of configuration snippets 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:

  • user
  • error_log
  • pid
  • access_log

Nginx test and restart

  • To verify Nginx config

    nginx -t
  • To verify Nginx config with a custom file

    nginx -t -c nginx.conf
  • To reload Nginx and apply the new config

    nginx -s reload

Basic structure

This repository has the following structure:

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

    This directory should contain all the server definitions.

    Except if they are dot prefixed or non .conf extension, all files in this folder are loaded automatically.

    • templates folder

      Files in this folder contain a server template for secure and non-secure hosts. They are intended to be copied in the conf.d folder with all example.com occurrences changed to the target host.

  • h5bp/

    This directory contains config snippets (mixins) to be included as desired.

    There are two types of config files provided, individual config snippets and combined config files which provide convenient defaults.

    • basic.conf

      This file loads a small subset of the rules provided by this repository to add expires headers, allow cross-domain fonts and protect system files from web access. The basic.conf file includes the rules which are recommended to always be defined.

    • location/

      Files in this folder contain one or more location directives. They are intended to be loaded in the server context (or, in a nested location block).

  • custom.d/

    This directory should contain all the custom nginx.conf configuration.

    Except if they are dot prefixed or non .conf extension, all files in this folder are loaded automatically.

  • mime.types

    The mime.types file is responsible for mapping file extensions to mime types.

  • nginx.conf

    The main Nginx config file.

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
  • Creating a new site

    cp templates/example.com.conf .actual-hostname.conf
    sed -i 's/example.com/actual-hostname/g' .actual-hostname.conf
  • Enabling a site

    mv .actual-hostname.conf actual-hostname.conf
  • Disabling a site

    mv actual-hostname.conf .actual-hostname.conf
nginx -s reload

Support

  • Nginx v1.8.0+

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].