13 messages in ru.sysoev.nginxRe: default page
FromSent OnAttachments
Marcos NevesJun 30, 2008 1:15 pm 
Cliff WellsJun 30, 2008 1:23 pm 
Marcos NevesJul 1, 2008 4:03 am 
Maxim DouninJul 1, 2008 6:09 am 
Igor SysoevJul 1, 2008 6:15 am 
Marcos NevesJul 1, 2008 6:27 am 
Igor SysoevJul 1, 2008 6:50 am 
Adam SetzlerJul 1, 2008 6:51 am 
Marcos NevesJul 1, 2008 7:08 am 
Cliff WellsJul 1, 2008 9:17 am 
Marcos NevesJul 2, 2008 3:03 am 
Maxim DouninJul 2, 2008 6:19 am 
Aleksandar LazicJul 5, 2008 4:33 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: default pageActions...
From:Cliff Wells (clif@public.gmane.org)
Date:Jun 30, 2008 1:23:47 pm
List:ru.sysoev.nginx

On Mon, 2008-06-30 at 17:16 -0300, Marcos Neves wrote:

I´m doing this to show a default favicon.ico, when the site doesn´t have one:

location = /favicon.ico { if (!-f $request_filename) { rewrite ^.*$ /favicon.ico.default; } } location = /favicon.ico.default { internal; alias html/favicon.ico; break; }

But I think it´s to ugly and far from DRY. Is there any way to short this code?

Not sure how "DRY" applies in this context...

What you probably want is something like this:

location = /favicon.ico { error_page 404 html/favicon.ico; }

Cliff