Skip to content

Recreate /tmp/nginx/body before testing nginx config - #5914

Open
PrassanthVG wants to merge 1 commit into
NginxProxyManager:developfrom
PrassanthVG:fix/tmp-nginx-missing
Open

PrassanthVG wants to merge 1 commit into
NginxProxyManager:developfrom
PrassanthVG:fix/tmp-nginx-missing

Conversation

@PrassanthVG

@PrassanthVG PrassanthVG commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

The directory was only created at container start, so if it was removed later every host/certificate save failed with Internal Error.

Fixes #5895

Why

Fixes #5895. /tmp/nginx/body (client_body_temp_path) is only created at container start. If it is removed later, every nginx test fails and saves return "Internal Error". The directory is now recreated before each nginx config test.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Code refactoring
  • API changes
  • Performance improvement
  • Test addition or update

AI Usage

  • AI was used to write this
  • AI was used to review this

The directory was only created at container start, so if it was
removed later every host/certificate save failed with Internal Error.

Fixes NginxProxyManager#5895
@greptile-apps

greptile-apps Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 4/5

[Medium risk] Adds directory creation to nginx config test.

The PR should not merge until directory-creation errors follow the configuration test’s existing cleanup path.

Findings

  1. P1 Creation error skips config cleanup ▶

Summary

The PR recreates nginx’s client-body temporary directory before each configuration test to recover when the directory has been removed after container startup.

  • A directory-creation error during the second configuration test can bypass the existing invalid-config cleanup.

Reviews (1) · Last reviewed commit: "Recreate /tmp/nginx/body before testing ..."

Comment thread backend/internal/nginx.js
test: () => {
debug(logger, "Testing Nginx configuration");
// nginx.conf points client_body_temp_path here; it only gets created at container start
fs.mkdirSync("/tmp/nginx/body", { recursive: true });

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Creation error skips config cleanup

If directory creation fails during configure()'s second nginx test—for example, because /tmp/nginx becomes unwritable after the first test—mkdirSync throws before test() returns a promise. The failure handler is never attached, so it cannot mark the newly generated config as invalid or remove it. If that config is invalid, later saves can keep failing even after directory access is restored. Make directory-creation errors reject the promise so the existing cleanup runs.

@nginxproxymanagerci

Copy link
Copy Markdown

Docker Image for build 1 is available on DockerHub:

nginxproxymanager/nginx-proxy-manager-dev:pr-5914

Note

Ensure you backup your NPM instance before testing this image! Especially if there are database changes.
This is a different docker image namespace than the official image.

Warning

Changes and additions to DNS Providers require verification by at least 2 members of the community!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

missing /tmp/nginx directory let NPM fail

1 participant