An open API service indexing awesome lists of open source software.

https://github.com/jamesits/nginx-config-boilerplate

Modular Nginx config for modern, secure sites in 2023.
https://github.com/jamesits/nginx-config-boilerplate

nginx-configuration

Last synced: 8 months ago
JSON representation

Modular Nginx config for modern, secure sites in 2023.

Awesome Lists containing this project

README

          

# Nginx Config Boilerplate

**Modular Nginx config for modern, secure sites in ~2018 2019 2020 2021 2022~ 2023.**

> 凭谁问:廉颇老矣,尚能饭否?——辛弃疾

This project aims to be a modular Nginx config template to ease common tasks like proxying websites, redirecting URLs, (semi-automatically) signing Let's Encrypt, offloading SSL, etc.

## Compatibility

We assume you are always using the newest mainline version of Nginx with at least the official sets of modules. Some new exciting features (http2, stream, etc.) are not supported on old versions (stable and/or distro packages).

[Here](https://nginx.org/en/linux_packages.html) is instruction for installing latest version of nginx.

Compatibility with other Nginx-derived projects (OpenResty, etc.) and 3rd party modules are not verifyed. If you have interest in verifying with/supporting them, contributions are welcomed.

## Installation

If you already have production sites running on Nginx, don't do anything stupid. You should only take essential pieces from here and evaluate your own config on staging environment.

If you are starting with a clean Nginx installation without any custom config, you can directly replace your nginx config sketelon with this one:

```shell
# run as root
rm -r /etc/nginx
git clone https://github.com/Jamesits/nginx-config-boilerplate.git /etc/nginx
cd /etc/nginx
./helper_scripts/kickstart.sh

mkdir -p /etc/systemd/system/nginx.service.d
cat > /etc/systemd/system/nginx.service.d/override.conf <