default page

Maxim Dounin mdounin at mdounin.ru
Wed Jul 2 17:20:04 MSD 2008


Hello!

On Wed, Jul 02, 2008 at 07:04:22AM -0300, Marcos Neves wrote:

>I realize that error_page will never work, cause I need to send a file
>that is not reachable by uri,
>those files are inside nginx html folder.
>What now?

location /my_files_not_reachable_by_uri/ {
     internal;
     root ...;
}

or even

location @my_files_not_reachable_by_uri {
     root ...;
}

See http://wiki.codemongers.com/NginxHttpCoreModule for more 
information.

Maxim Dounin

>
>On Tue, Jul 1, 2008 at 1:18 PM, Cliff Wells <cliff at develix.com> wrote:
>> On Tue, 2008-07-01 at 11:08 -0300, Marcos Neves wrote:
>>> The point is that I want to return a default icon, but only if the
>>> site doesn?t have one.
>>> That?s why the ugly if (!-f $request_filename) { construction.
>>> empty_gif; wouldn?t solve the problem ether.
>>> I?m using the same for show a default error page if the domain doesn?t
>>> have it?s own.
>>>
>>> Do you think that touch disk with !-f $request_filename can be a
>>> problem for performance?
>>
>> What's wrong with using the error_page directive?  If you are returning
>> the same gif for all domains that don't have a favicon it should work
>> fine.  As Maxim pointed out, you can override the 404 return code.
>>
>> Cliff
>>
>>
>>
>
>
>
>-- 
>Marcos Neves
>+55 44 3263-8132
>+55 44 9918-8488
>





More information about the nginx mailing list