Every write of a host config now goes through one configure() that runs under a re-entrant lock (lib/nginx-lock.js), so concurrent saves can't test or rename each other's files: - the new config is written and checked with nginx -t; when nginx rejects this host, the previous file (and .err file) is put back and an NginxConfigError with structured details is thrown (scope host/global, file, line, humanised message and hint, raw nginx output) - when another host's file breaks the test, that host is only blamed when it fails on its own (lib/nginx-blame.js). It is regenerated from its database row first and only moved to .err and marked offline when that fails too. A conflict with the change being saved fails the save instead. An error that names no file (eg. an unknown variable) is only a conflict when it goes away with every other host's config moved aside; otherwise it is the host's own error and, when its advanced config uses the variable or path, reads "Advanced configuration: ..." - errors are humanised (lib/nginx-errors.js) and mapped to the advanced config of the host where possible (new begin/end markers in the templates) - the API returns error.details; a middleware redacts details that name a host the user can't see - bulkGenerateConfigs (certificates) and the default site go through the same path, a host nginx rejects is taken offline instead of failing all - nginx -s reload only signals the master, which reads the config later. reloadNginx() waits (bounded, 5 s) until the master runs a new generation of workers and the old ones are shutting down (lib/nginx-reload.js, from /proc) before the lock is released, otherwise the next holder's rejected candidate file could be what the master reads and the change saved before would never be applied. A reload that can't be confirmed is repeated once at the end of the locked section, after every rollback. When nginx logs an [emerg] for the reload (eg. a listen port in use, which nginx -t doesn't catch) the wait ends as soon as nginx gives up on it (for a bind() after its own retries), and after a repeated reload that isn't confirmed either, later saves don't repeat it until a reload is confirmed again, so they don't each wait 10 s - reconcile() regenerates missing / moved-aside configs and retries hosts whose upstream didn't resolve yet; the startup commit runs it from backend/index.js (NPM_RECONCILE_ON_START) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|---|---|---|
| .github | ||
| backend | ||
| docker | ||
| docs | ||
| frontend | ||
| scripts | ||
| test | ||
| .gitattributes | ||
| .gitignore | ||
| .version | ||
| LICENSE | ||
| README.md | ||
| SECURITY.md | ||
This project comes as a pre-built Docker image that enables you to easily forward to your websites running at home or otherwise, including free SSL, without having to know too much about Nginx or Letsencrypt.
Project Goal
I created this project to fill a personal need to provide users with an easy way to accomplish reverse proxying hosts with SSL termination, and it had to be so easy that a monkey could do it. This goal hasn't changed. While there might be advanced options, they are optional, and the project should be as simple as possible so that the barrier to entry here is low.
Features
- Beautiful and Secure Admin Interface based on Tabler
- Easily create forwarding domains, redirections, streams, and 404 hosts without knowing anything about Nginx
- Free SSL using Let's Encrypt or provide your own custom SSL certificates
- Access Lists and basic HTTP Authentication for your hosts
- Advanced Nginx configuration available for super users
- User management, permissions, and audit log
::: warning
armv7 is no longer supported in version 2.14+. This is due to Nodejs dropping support for armhf. Please
use the 2.13.7 image tag if this applies to you.
:::
Hosting your home network
I won't go into too much detail here, but here are the basics for someone new to this self-hosted world.
- Your home router will have a Port Forwarding section somewhere. Log in and find it
- Add port forwarding for ports 80 and 443 to the server hosting this project
- Configure your domain name details to point to your home, either with a static ip or a service like
- DuckDNS
- Amazon Route53
- Cloudflare
- Use the Nginx Proxy Manager as your gateway to forward to your other web-based services
Quick Setup
- Install Docker
- Create a docker-compose.yml file similar to this:
services:
app:
image: 'docker.io/jc21/nginx-proxy-manager:latest'
restart: unless-stopped
ports:
- '80:80'
- '81:81'
- '443:443'
volumes:
- ./data:/data
- ./letsencrypt:/etc/letsencrypt
This is the bare minimum configuration required. See the documentation for more.
- Bring up your stack by running
docker compose up -d
- Log in to the Admin UI
When your docker container is running, connect to it on port 81 for the admin interface.
Sometimes this can take a little bit because of the entropy of keys.
Contributing
All are welcome to create pull requests for this project, against the develop branch. Official releases are created from the master branch.
CI is used in this project. All PR's must pass before being considered. After passing, docker builds for PR's are available on dockerhub for manual verifications.
Documentation within the develop branch is available for preview at
https://develop.nginxproxymanager.com
Contributors
Special thanks to all of our contributors.
