From: Sergey Kandaurov Date: Mon, 19 Oct 2026 15:53:30 +0000 (+0000) Subject: Core: working_directory relative to prefix X-Git-Tag: release-1.31.8~2 X-Git-Url: https://git.kaiwu.me/%7B@url%7D?a=commitdiff_plain;h=0e20f1fb0fd0cef31f196f166088f60228a86e4a;p=nginx.git Core: working_directory relative to prefix 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. --- diff --git a/src/core/nginx.c b/src/core/nginx.c index d827f3fc9..88f22483f 100644 --- a/src/core/nginx.c +++ b/src/core/nginx.c @@ -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) {