Opened 7 years ago

Closed 7 years ago

#1547 closed defect (invalid)

Nginx trying to create NGX_HTTP_PROXY_TEMP_PATH even when it is overridden via configuration file

Reported by: ROMB@… Owned by:
Priority: minor Milestone:
Component: other Version: 1.12.x
Keywords: Cc:
uname -a: Linux 25cc833843bc 4.9.49-moby #1 SMP Wed Sep 27 00:36:29 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
nginx -V: nginx version: nginx/1.12.2
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-16) (GCC)
built with OpenSSL 1.0.2k-fips 26 Jan 2017
TLS SNI support enabled
configure arguments: --prefix=/opt/nginx --with-http_ssl_module --with-http_v2_module --with-http_realip_module --with-http_gzip_static_module --with-http_stub_status_m
odule --with-http_addition_module --with-cc-opt=-Wno-error --with-ld-opt= --add-module=/home/redmine/.rvm/gems/ruby-2.4.1/gems/passenger-5.2.3/src/nginx_module

Description

configuration slice:

http {
    client_body_temp_path      /var/nginx/client_body_temp;
    proxy_temp_path            /var/nginx/proxy_temp;
    fastcgi_temp_path          /var/nginx/fastcgi_temp;
    uwsgi_temp_path            /var/nginx/uwsgi_temp;
    scgi_temp_path             /var/nginx/scgi_temp;
}

strace log:

open("/var/run/nginx/nginx.pid", O_RDWR|O_CREAT, 0644) = 4
close(4)                                = 0
mkdir("/var/nginx/client_body_temp", 0700) = -1 EEXIST (File exists)
mkdir("/var/nginx/proxy_temp", 0700)    = -1 EEXIST (File exists)
mkdir("/var/nginx/fastcgi_temp", 0700)  = -1 EEXIST (File exists)
mkdir("/var/nginx/uwsgi_temp", 0700)    = -1 EEXIST (File exists)
mkdir("/var/nginx/scgi_temp", 0700)     = -1 EEXIST (File exists)
mkdir("/opt/nginx/proxy_temp", 0700)    = -1 EACCES (Permission denied)
write(3, "2018/05/08 10:17:55 [emerg] 3740"..., 100) = 100
write(2, "nginx: [emerg] mkdir() \"/opt/ngi"..., 78nginx: [emerg] mkdir() "/opt/nginx/proxy_temp" failed (13: Permission denied)
) = 78
brk(NULL)                             = 0xa1a000

So, as you can see according to config and strace, all temp paths already exists and overridden from defaults, but for some unknown reason nginx still trying to create /opt/nginx/proxy_temp

Change History (2)

comment:1 by ROMB@…, 7 years ago

And after looking more at my nginx -V, I do understand that this is probably passenger and not nginx bug. With the high chance it is caused by

static ngx_path_init_t  ngx_http_proxy_temp_path = {
    ngx_string(NGX_HTTP_PROXY_TEMP_PATH), { 1, 2, 0 }
};

But, I'm not an C expert, so leave it there for some comments.

Edit:
Yep, I can confirm that this is passenger bug. nginx without this module works perfectly. Ticket may be closed.

Version 2, edited 7 years ago by ROMB@… (previous) (next) (diff)

comment:2 by Maxim Dounin, 7 years ago

Resolution: invalid
Status: newclosed
Note: See TracTickets for help on using tickets.