]> git.kaiwu.me - nginx.git/commitdiff
Core: working_directory relative to prefix
authorSergey Kandaurov <pluknet@nginx.com>
Mon, 19 Oct 2026 15:53:30 +0000 (15:53 +0000)
committerSergey Kandaurov <pluknet@nginx.com>
Wed, 21 Oct 2026 07:48:28 +0000 (11:48 +0400)
Previously, a relative path was resolved against the current working
directory of the master process, which depends on how nginx is started.
Now it is resolved relative to prefix, similar to pid and error_log.

src/core/nginx.c

index d827f3fc9051c53626b3a4ccda511171e59dd296..88f22483f1677f308ebab531690d1d70a53e66cb 100644 (file)
@@ -1231,6 +1231,13 @@ ngx_core_module_init_conf(ngx_cycle_t *cycle, void *conf)
                NGX_OLDPID_EXT, sizeof(NGX_OLDPID_EXT));
 
 
+    if (ccf->working_directory.len) {
+        if (ngx_conf_full_name(cycle, &ccf->working_directory, 0) != NGX_OK) {
+            return NGX_CONF_ERROR;
+        }
+    }
+
+
 #if !(NGX_WIN32)
 
     if (ccf->user == (uid_t) NGX_CONF_UNSET_UINT && geteuid() == 0) {