On Sun, Aug 15, 2010 at 12:39 AM, Igor Sysoev <span dir="ltr"><<a href="mailto:igor@sysoev.ru">igor@sysoev.ru</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div><div></div><div class="h5">On Sat, Aug 14, 2010 at 12:14:46PM -0700, kevin wrote:<br>
<br>
> On Sat, Aug 14, 2010 at 12:01 PM, Edho P Arief <<a href="mailto:edhoprima@gmail.com">edhoprima@gmail.com</a>> wrote:<br>
><br>
> > On Sun, Aug 15, 2010 at 1:49 AM, kevin <<a href="mailto:kevincastiglione@gmail.com">kevincastiglione@gmail.com</a>> wrote:<br>
> > > On Sat, Aug 14, 2010 at 11:42 AM, kevin <<a href="mailto:kevincastiglione@gmail.com">kevincastiglione@gmail.com</a>><br>
> > wrote:<br>
> > >><br>
> > >> On Sat, Aug 14, 2010 at 10:07 AM, Igor Sysoev <<a href="mailto:igor@sysoev.ru">igor@sysoev.ru</a>> wrote:<br>
> > >>><br>
> > >>> On Fri, Aug 13, 2010 at 07:43:58PM -0700, kevin wrote:<br>
> > >>><br>
> > >>> > requests like these are hitting my server, and i want to catch these<br>
> > >>> > requests, and return 'not found' from nginx. i dont want it to hit my<br>
> > >>> > fastcgi backend.<br>
> > >>> ><br>
> > >>> > [13/Aug/2010:19:39:26 -0700] "POST /%5C%22http:%5C/%5C/<br>
> > >>> ><br>
> > >>> > <a href="http://photos-b.ak.fbcdn.net" target="_blank">photos-b.ak.fbcdn.net</a><br>
> > %5C/photos-ak-snc1%5C/v43%5C/64%5C/68931197560%5C/app_2_68931197560_3211.gif%5C%22<br>
> > >>> > HTTP/1.1" 404 103 "-" "Mozilla/5.0 (Macintosh; U; Intel Mac OS X<br>
> > 10.5;<br>
> > >>> > en-US; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8" 0.087 US<br>
> > >>> ><br>
> > >>> ><br>
> > >>> > how do i match requests with url starting like this:<br>
> > >>> ><br>
> > >>> > /%5C%22http:%5C/%5C/<br>
> > >>><br>
> > >>> Try<br>
> > >>> location /\"http:\/\/ {<br>
> > ><br>
> > > I tried this, but did not help<br>
> > ><br>
> > > location /\"http:\/\/ {<br>
> > > access_log logs/junk.log wtop;<br>
> > > rewrite ^/(.*) <a href="http://www.XXX.com" target="_blank">www.XXX.com</a> permanent;<br>
> > > }<br>
> > ><br>
> > ><br>
> > > it does not catch it. it is still hitting my fastcgi backend<br>
> > ><br>
> ><br>
> > put it in the topmost of your server block.<br>
> ><br>
> yes i have it in the top most position in server block. all other location<br>
> sections are below this and it still does not catch it. it is going to the<br>
> location that matches the last block<br>
> location / {<br>
<br>
</div></div>Sorry, the slashes should be escaped, this is working configuration:<br>
<br>
location ^~ /\\"http:\\/\\/ {<br>
return 404;<br>
}<br>
<br>
"^~" is to disable regex locations.<br></blockquote><div>thanks a lot! this catches it and returns 404!<br><br>is it possible to customize the 404 message for this location?<br>thanks!<br></div></div>