Welcome! Log In Create A New Profile

Advanced

Re: Check if php-file exists in chroot jail

Francis Daly
March 22, 2012 02:48PM
On Thu, Mar 22, 2012 at 05:24:10AM -0400, maverick78 wrote:

Hi there,

> Ops, sorry. It's www. Tht was a fault of mine and I corrected it. But
> it's the same result. Every .php-page shows 404 not found.

This time, I've actually tested what I suggest ;-)

try_files takes arguments of uris, which it then looks for as files by
prefixing $document_root.

So you must leave "root" set correctly for nginx if you want nginx to
care about files.

Without try_files in this case, nginx doesn't care about files; with it,
it does.

So: leave "root" alone (as /www/example.com/public), and just set the
correct fastcgi_param values.

Something like:

include fastcgi.conf;
fastcgi_param SCRIPT_FILENAME /public$fastcgi_script_name;

could be sufficient. You might also want

fastcgi_param DOCUMENT_ROOT /public;

if your code cares about that variable.

Then "try_files $uri =404" and "fasctcgi_pass ..." work for me.

> And the
> dubug-log only complains about the favicon that cannot be found. But the
> file hello.php (a hello world script) definitely exists.

For information: that's not the debug log.

The debug log shows every uri / filename that try_files tests (among
many other things).

If you still have difficulties, it may be worth enabling the debug log
just to see what it does show.

Good luck with it,

f
--
Francis Daly francis@daoine.org

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Check if php-file exists in chroot jail

maverick78 March 21, 2012 10:05AM

Re: Check if php-file exists in chroot jail

Valentin V. Bartenev March 21, 2012 12:16PM

Re: Check if php-file exists in chroot jail

maverick78 March 21, 2012 01:10PM

Re: Check if php-file exists in chroot jail

Valentin V. Bartenev March 21, 2012 03:00PM

Re: Check if php-file exists in chroot jail

Francis Daly March 21, 2012 03:02PM

Re: Check if php-file exists in chroot jail

maverick78 March 21, 2012 05:22PM

Re: Check if php-file exists in chroot jail

Francis Daly March 21, 2012 07:24PM

Re: Check if php-file exists in chroot jail

maverick78 March 22, 2012 05:24AM

Re: Check if php-file exists in chroot jail

Francis Daly March 22, 2012 02:48PM

Re: Check if php-file exists in chroot jail

maverick78 March 22, 2012 04:17PM

Re: Check if php-file exists in chroot jail

Volodymyr Kostyrko March 24, 2012 12:32PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 298
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready