Help with code

Nick Toseland nick at livejournalinc.com
Mon Jul 22 15:39:08 UTC 2013


Hi All,

I have the following code:

                location = /favicon.ico {
                        if ($host = "abc.com"){
                            return 301 "http://www.abc.com/favicon.ico";
                        }
                }

If I make a request to abc.com/favicon.ico I get a 301 and then a 200 OK

However the issue is that if I make a request to xyz.abc.com/favicon.ico 
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

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?

Thanks in advance.

Nick


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20130722/890081fe/attachment.html>


More information about the nginx mailing list