On Mon, May 12, 2014 at 08:04:07AM -0700, Chris Cappuccio wrote: > Jonathan Gray [j...@jsg.id.au] 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.
The real issue here is that you're changing what the -p flag means, it used to be the root directory for paths in the config file referred to within the chroot, not the location of the chroot itself. So by using -p I could have a seperate set of logs as well > > You could fix it by not using nginx -p ... That does not give me the previous behaviour (ie seperate logs). > > 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; I've adapted my usage from the old behaviour to the new -p specifies the chroot path with lines similiar to the above (though with /var/www/test/cache to match the parent dir) These config lines need to be in the http section of the config if anyone else has the same problem.