<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On 22.07.2013, at 17:39, Nick Toseland <<a href="mailto:nick@livejournalinc.com">nick@livejournalinc.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">
  

    <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
  
  <div bgcolor="#FFFFFF" text="#000000">
    Hi All,<br>
    <br>
    I have the following code:<br>
    <br>
                   location = /favicon.ico {<br>
                           if ($host = "<a href="http://abc.com">abc.com</a>"){<br>
                               return 301
    <a class="moz-txt-link-rfc2396E" href="http://www.abc.com/favicon.ico">"http://www.abc.com/favicon.ico"</a>;<br>
                           }<br>
                   }<br>
    <br>
    If I make a request to <a href="http://abc.com/favicon.ico">abc.com/favicon.ico</a> I get a 301 and then a
    200 OK<br>
    <br>
    However the issue is that if I make a request to
    <a href="http://xyz.abc.com/favicon.ico">xyz.abc.com/favicon.ico</a> I get a 404 as it passes the first match
    statement but fails the second and trys to get the favicon resource
    from the nginx root directory<br></div></blockquote><div><br></div><div>Why should the check process even go inside the if, given that <a href="http://xyz.abc.com">xyz.abc.com</a> is not host <a href="http://abc.com">abc.com</a>?</div><div><br></div><div>Jan</div><br><blockquote type="cite"><div bgcolor="#FFFFFF" text="#000000">
    <br>
    Is there a better way of doing it so it continues on to be evaluated
    by the other rules? or Is there a better way of writing this part of
    the code?<br>
    <br>
    Thanks in advance.<br>
    <br>
    Nick<br>
    <br>
    <meta http-equiv="content-type" content="text/html;
      charset=ISO-8859-1">
    <br>
  </div>

_______________________________________________<br>nginx mailing list<br><a href="mailto:nginx@nginx.org">nginx@nginx.org</a><br><a href="http://mailman.nginx.org/mailman/listinfo/nginx">http://mailman.nginx.org/mailman/listinfo/nginx</a></blockquote></div><br></body></html>