Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions backend/internal/nginx.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ const internalNginx = {
*/
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.

return utils.execFile("/usr/sbin/nginx", ["-t", "-g", "error_log off;"]);
},

Expand Down