<span style="color: rgb(51, 51, 51);">Do this to return No Content...</span><br style="color: rgb(51, 51, 51);"><br style="color: rgb(51, 51, 51);"><span style="font-family: courier new,monospace; color: rgb(51, 51, 51);">location = /favicon.ico {</span><br style="font-family: courier new,monospace; color: rgb(51, 51, 51);">
<span style="font-family: courier new,monospace; color: rgb(51, 51, 51);"> &nbsp; &nbsp; &nbsp; &nbsp;return 204;</span><br style="font-family: courier new,monospace; color: rgb(51, 51, 51);"><span style="font-family: courier new,monospace; color: rgb(51, 51, 51);">}</span><br style="color: rgb(51, 51, 51);">
<br style="color: rgb(51, 51, 51);"><span style="color: rgb(51, 51, 51);">Or this to do basically the same, which spits out an empty gif from memory...</span><br style="color: rgb(51, 51, 51);"><br style="color: rgb(51, 51, 51);">
<span style="font-family: courier new,monospace; color: rgb(51, 51, 51);">location = /favicon.ico {</span><br style="font-family: courier new,monospace; color: rgb(51, 51, 51);"><span style="font-family: courier new,monospace; color: rgb(51, 51, 51);"> &nbsp; &nbsp; &nbsp; empty_gif;</span><br style="font-family: courier new,monospace; color: rgb(51, 51, 51);">
<span style="font-family: courier new,monospace; color: rgb(51, 51, 51);">}</span><br><br><br>On Tue, Jul 1, 2008 at 8:27 AM, Marcos Neves &lt;<a href="mailto:marcos.neves@gmail.com">marcos.neves@gmail.com</a>&gt; wrote:<br>
&gt;<br>&gt; My current solution works:<br>&gt;<br>&gt; location = /favicon.ico {<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; if (!-f $request_filename) {<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; rewrite ^.*$ /favicon.ico.default;<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&gt; &nbsp; &nbsp; &nbsp; }<br>&gt; &nbsp; &nbsp; &nbsp; location = /favicon.ico.default {<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; internal;<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; alias html/favicon.ico;<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; break;<br>&gt; &nbsp; &nbsp; &nbsp; }<br>&gt;<br>&gt; but would be nice if possible to do this:<br>&gt;<br>&gt;<br>&gt; location = /favicon.ico {<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; if (!-f $request_filename) {<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; alias html/favicon.ico;<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; break;<br>&gt; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&gt;<br>&gt; But alias canĀ“t be used inside an if. Why that?<br>&gt;<br>&gt; On Tue, Jul 1, 2008 at 10:15 AM, Igor Sysoev &lt;<a href="mailto:is@rambler-co.ru">is@rambler-co.ru</a>&gt; wrote:<br>
&gt; &gt; On Tue, Jul 01, 2008 at 05:09:33PM +0400, Maxim Dounin wrote:<br>&gt; &gt;<br>&gt; &gt;&gt; Hello!<br>&gt; &gt;&gt;<br>&gt; &gt;&gt; On Tue, Jul 01, 2008 at 08:03:23AM -0300, Marcos Neves wrote:<br>&gt; &gt;&gt;<br>
&gt; &gt;&gt; &gt;your solution is DRY, but I?m not sure if it?s right to send a 404 code,<br>&gt; &gt;&gt; &gt;is it?<br>&gt; &gt;&gt;<br>&gt; &gt;&gt; Feel free to use<br>&gt; &gt;&gt;<br>&gt; &gt;&gt; &nbsp; &nbsp;error_page 404 = html/favicon.ico;<br>
&gt; &gt;&gt;<br>&gt; &gt;&gt; instead (note the &#39;=&#39;).<br>&gt; &gt;&gt;<br>&gt; &gt;&gt; See <a href="http://wiki.codemongers.com/NginxHttpCoreModule#error_page">http://wiki.codemongers.com/NginxHttpCoreModule#error_page</a> for<br>
&gt; &gt;&gt; details.<br>&gt; &gt;<br>&gt; &gt; No, html/favicon.ico will not work. It should be redirected to something like<br>&gt; &gt; /html/favicon.ico, and then some location /html/... should be described.<br>&gt; &gt;<br>
&gt; &gt;&gt; Maxim Dounin<br>&gt; &gt;&gt;<br>&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; &gt;On Mon, Jun 30, 2008 at 5:24 PM, Cliff Wells &lt;<a href="mailto:cliff@develix.com">cliff@develix.com</a>&gt; wrote:<br>&gt; &gt;&gt; &gt;&gt;On Mon, 2008-06-30 at 17:16 -0300, Marcos Neves wrote:<br>
&gt; &gt;&gt; &gt;&gt;&gt;I?m doing this to show a default favicon.ico, when the site doesn?t have<br>&gt; &gt;&gt; &gt;&gt;&gt;one:<br>&gt; &gt;&gt; &gt;&gt;&gt;<br>&gt; &gt;&gt; &gt;&gt;&gt; &nbsp; &nbsp; &nbsp; location = /favicon.ico {<br>
&gt; &gt;&gt; &gt;&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (!-f $request_filename) {<br>&gt; &gt;&gt; &gt;&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;rewrite ^.*$ /favicon.ico.default;<br>&gt; &gt;&gt; &gt;&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br>&gt; &gt;&gt; &gt;&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;}<br>
&gt; &gt;&gt; &gt;&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;location = /favicon.ico.default {<br>&gt; &gt;&gt; &gt;&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;internal;<br>&gt; &gt;&gt; &gt;&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;alias html/favicon.ico;<br>&gt; &gt;&gt; &gt;&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;break;<br>
&gt; &gt;&gt; &gt;&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp;}<br>&gt; &gt;&gt; &gt;&gt;&gt;<br>&gt; &gt;&gt; &gt;&gt;&gt;But I think it?s to ugly and far from DRY.<br>&gt; &gt;&gt; &gt;&gt;&gt;Is there any way to short this code?<br>&gt; &gt;&gt; &gt;&gt;<br>
&gt; &gt;&gt; &gt;&gt;Not sure how &quot;DRY&quot; applies in this context...<br>&gt; &gt;&gt; &gt;&gt;<br>&gt; &gt;&gt; &gt;&gt;What you probably want is something like this:<br>&gt; &gt;&gt; &gt;&gt;<br>&gt; &gt;&gt; &gt;&gt;location = /favicon.ico {<br>
&gt; &gt;&gt; &gt;&gt; &nbsp;error_page 404 html/favicon.ico;<br>&gt; &gt;&gt; &gt;&gt;}<br>&gt; &gt;&gt; &gt;&gt;<br>&gt; &gt;&gt; &gt;&gt;Cliff<br>&gt; &gt;&gt; &gt;&gt;<br>&gt; &gt;&gt; &gt;&gt;<br>&gt; &gt;&gt; &gt;&gt;<br>
&gt; &gt;&gt; &gt;&gt;<br>&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; &gt;--<br>&gt; &gt;&gt; &gt;Marcos Neves<br>&gt; &gt;&gt; &gt;+55 44 3263-8132<br>&gt; &gt;&gt; &gt;+55 44 9918-8488<br>
&gt; &gt;&gt; &gt;<br>&gt; &gt;<br>&gt; &gt; --<br>&gt; &gt; Igor Sysoev<br>&gt; &gt; <a href="http://sysoev.ru/en/">http://sysoev.ru/en/</a><br>&gt; &gt;<br>&gt; &gt;<br>&gt;<br>&gt;<br>&gt;<br>&gt; --<br>&gt; Marcos Neves<br>
&gt; +55 44 3263-8132<br>&gt; +55 44 9918-8488<br>&gt;<br><br>