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.
- Host: GitHub
- URL: https://github.com/jamesits/nginx-config-boilerplate
- Owner: Jamesits
- License: other
- Created: 2018-05-14T10:32:33.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-12-21T06:08:03.000Z (almost 2 years ago)
- Last Synced: 2025-03-28T04:35:02.250Z (9 months ago)
- Topics: nginx-configuration
- Language: Shell
- Homepage:
- Size: 109 KB
- Stars: 28
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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 <