Jonathan Gray [[email protected]] wrote:
>
> This seems to break my use of -p here
>
> --- nginx.conf Mon May 5 16:25:36 2014
> +++ test.conf Mon May 12 18:51:13 2014
> @@ -45,7 +45,7 @@ http {
> listen 80;
> listen [::]:80;
> server_name localhost;
> - root /var/www/htdocs;
> + root /var/www/test/htdocs;
>
> #charset koi8-r;
>
>
> # nginx -c /etc/nginx/test.conf -p /var/www/test/
> nginx: [emerg] mkdir() "var/www/cache/client_body_temp" failed (2: No such
> file or directory)
>
The chroot happens early.
Your use case only worked before because it's stored under /var/www!
That was also hard-coded in the prefix-path-stripper, yet the chroot
location was dynamic based on the user homedir.
You could fix it by not using nginx -p ...
Alternately you can leave everything else the same and
use something like this in your config:
client_body_temp_path /var/www/test/tmp/client_body_temp;
proxy_temp_path /var/www/test/tmp/proxy_temp;
fastcgi_temp_path /var/www/test/tmp/fastcgi_temp;
scgi_temp_path /var/www/test/tmp/scgi_temp;
uwsgi_temp_path /var/www/test/tmp/uwsgi_temp;
Although, the next diff is to make this action unnecessary. Obviously
there's no reason for those default paths to be hardcoded to /var/www.