Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Passenger trying to create NGX_HTTP_PROXY_TEMP_PATH folder. #2075

Open
CamJN opened this issue May 8, 2018 · 10 comments
Open

Passenger trying to create NGX_HTTP_PROXY_TEMP_PATH folder. #2075

CamJN opened this issue May 8, 2018 · 10 comments

Comments

@CamJN
Copy link
Member

CamJN commented May 8, 2018

The module creates a folder which is not used by Passenger, even when nginx configuration overrides NGX_HTTP_PROXY_TEMP_PATH.

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/nginx/proxy_temp\" failed (13: Permission denied)"..., 78) = 78

probably caused by src/nginx_module/Configuration.c line 64:

static ngx_path_init_t ngx_http_proxy_temp_path = {
ngx_string(NGX_HTTP_PROXY_TEMP_PATH), { 1, 2, 0 }
};
@ROMB
Copy link
Contributor

ROMB commented May 8, 2018

I actually submitted an easy PR #2074 to fix this.

@CamJN
Copy link
Member Author

CamJN commented May 9, 2018

Thanks for that, we'll review this as soon as we can. In the meantime could you sign the contributor agreement.

@ROMB
Copy link
Contributor

ROMB commented May 9, 2018

Already signed

@FooBarWidget
Copy link
Member

Thanks for submitting the pull request @ROMB. I'm wondering what other effects there are of removing that code. What will happen to the buffering behavior on the Nginx side?

@ROMB
Copy link
Contributor

ROMB commented May 10, 2018

I don't really know, not that much expert in nginx. If this variable and folder actually needed for buffering to work, than someone need to make that folder configurable setting, which I will not be able to do because of lack of experience.

@ROMB
Copy link
Contributor

ROMB commented Sep 13, 2019

Somebody just make this configurable please, as other passenger settings.

@CamJN
Copy link
Member Author

CamJN commented Nov 7, 2019

@ROMB are you comfortable building passenger from source to test out a config option? It seems to work for me, but I'd like more eyes on it.

@halo
Copy link

halo commented Dec 8, 2019

I just wanted to ask whether there is any work-around for this problem?

Background:

After upgrading, I cannot start nginx (1.17.6) with passenger (6.0.4) because it tries to create this subdirectory, but I don't have a /usr/local/var directory (and I don't need one, because nginx is installed at a custom location using homebrew)

nginx: [emerg] mkdir() "/usr/local/var/run/nginx/proxy_temp" failed (2: No such file or directory)

Setting proxy_buffering off; in my nginx.conf had no effect.

@ROMB
Copy link
Contributor

ROMB commented Dec 9, 2019 via email

@CamJN
Copy link
Member Author

CamJN commented Dec 9, 2019

Yes, the HEAD of the repo already has the patch merged, or you can apply the patch at https://github.com/phusion/passenger/commit/e512231f.patch?full_index=1 to 6.0.4. Then the option to configure is called passenger_temp_path.

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

No branches or pull requests

4 participants