mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2026-11-19 14:40:27 +00:00
For proxy hosts, redirection hosts, 404 hosts and streams. The request body is validated like a create/update (400 on invalid input), then the host config goes through a dry run with nginx -t. The result says whether nginx accepts the host, with the same humanised error a save would fail with, the state of each custom location and the reachability of the upstream targets, plus warnings (e.g. a certificate that would only be requested on save, or broken configs of other hosts). The dry run has no side effects: the host's file is only written for the test, no meta is patched, no .err file is touched, nginx is not reloaded, and broken files of other hosts are moved aside for the test and put back byte-identical instead of being repaired. A host that doesn't exist yet is rendered under a reserved, non-numeric name whose files are always removed. Needs the create permission, or update when an id is given. As on save, users who aren't admins can't test an advanced config of their own (403 before nginx -t runs; locations without one keep the saved one). Tests are rate limited and the targets they probe count against the per user budget of POST /upstreams/check (lib/upstream/check-budget.js); with the budget used up nginx is still tested and the targets are reported as rate_limited. Unit tests cover the result building and the dry run (an opt-in test, NPM_TEST_NGINX=1, runs it against a real nginx). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| cors.js | ||
| host-test-route.js | ||
| jwt-decode.js | ||
| jwt.js | ||
| log-request.js | ||
| pagination.js | ||
| rate-limit.js | ||
| user-id-from-me.js | ||