phpearth / docker-php

🐳 Docker For PHP developers - Docker images with PHP, Nginx, OpenLiteSpeed, Apache, Lighttpd, and Alpine
https://docs.php.earth/docker
MIT License
261 stars 80 forks source link

error open() "/var/tmp/nginx/fastcgi/1/00/0000000001" failed (13: Permission denied) while reading upstream #9

Closed insekticid closed 6 years ago

insekticid commented 6 years ago

Hi, I found another problem when doing very long output, nginx will try to cache response via output buffer

but you got this error open() "/var/tmp/nginx/fastcgi/1/00/0000000001" failed (13: Permission denied) while reading upstream

https://github.com/piwik/piwik/issues/11310#issuecomment-333145775

fixed it via RUN chown -R www-data:www-data /var/tmp/nginx

btw I am using your image as base for Piwik stats https://github.com/insekticid/docker-piwik/blob/master/Dockerfile

petk commented 6 years ago

Hello, I've checked this out and what might be better in this case is to run Nginx process as user and group nginx instead of the www-data... Alpine Linux has configured Nginx to run as nginx user and group and therefore sets these permissions on the mentioned temporary directory.

This is from the default /etc/nginx/nginx.conf on Alpine:

user nginx;
# ...

I can reproduce the same issue if I manually set the user to www-data in nginx.conf. So that's why the permissions need to be adjusted manually also on that directory.

In case this is still problematic or I've missed something, let me know... Thanks for reporting :+1: