displaying standard 404 page, if php file is not found

Edho P Arief edhoprima at gmail.com
Wed Jul 29 21:14:35 MSD 2009


On Wed, Jul 29, 2009 at 11:12 PM, Samuel Vogel<samydelux at gmail.com> wrote:
> Am 29.07.09 17:39, schrieb Edho P Arief:
>>
>> 2009/7/29 Samuel Vogel<samydelux at gmail.com>:
>>
>>>
>>> Doesn't seem to fix the problem either. My config now reads:
>>>
>>> server {
>>>    listen   80;
>>>    server_name  domain.de;
>>>
>>>    access_log  /var/log/nginx/domain.access.log;
>>>
>>>    location / {
>>>        root   /var/www/domain/www;
>>>        index  index.html index.php;
>>>    }
>>>
>>>    location ~ \.php$ {
>>>        try_files  $uri  @404;
>>>        root /www;
>>>
>>>        fastcgi_pass   unix:/var/run/php-fpm/domain.sock;
>>>        fastcgi_index  index.php;
>>>        fastcgi_param  SCRIPT_FILENAME
>>>  $document_root$fastcgi_script_name;
>>>        include fastcgi_params;
>>>    }
>>>
>>>    location @404 {
>>>        return 404;
>>>    }
>>>
>>>    location ~ /\.ht {
>>>        deny  all;
>>>    }
>>> }
>>>
>>>
>>>
>>
>> the root here is used by nginx - you need to specify full path.
>>
>> and change $document_root back to /www
>>
>
> Doesn't make a difference, just changed it because of Igor's suggestion!

which doesn't make difference?

root /var/www/domain/www;

or

fastcgi_param  SCRIPT_FILENAME /www$fastcgi_script_name;

??

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





More information about the nginx mailing list