displaying standard 404 page, if php file is not found

Edho P Arief edhoprima at gmail.com
Wed Jul 29 18:12:52 MSD 2009


On Wed, Jul 29, 2009 at 9:03 PM, Samuel Vogel<samydelux at gmail.com> wrote:
> Hey,
>
> I know this question has come up a couple of times, but the solutions posted
> here do not seem to work for me!
> Here is the important part of my configuration:
>
>    location ~ \.php$ {
>        try_files  $uri  @404;
>
>        fastcgi_pass   unix:/var/run/php-fpm/tourvital.sock;
>        fastcgi_index  index.php;
>        fastcgi_param  SCRIPT_FILENAME  www/$fastcgi_script_name;
>        include fastcgi_params;
>    }
>
>    location @404 {
>        return 404;
>    }
>
> This returns a 404 error for every PHP file, even existing ones!
>

where did you set the root directive? in another location block or in
server block?

also I don't remember ever seeing relative path for script_filename.


-- 
O< ascii ribbon campaign - stop html mail - www.asciiribbon.org





More information about the nginx mailing list