Welcome! Log In Create A New Profile

Advanced

Re: I need my “bad user agent” map not to block my rss xml file

January 10, 2019 11:08PM
On Thu, 10 Jan 2019 08:50:33 +0000
Francis Daly <francis@daoine.org> wrote:

> On Wed, Jan 09, 2019 at 06:14:04PM -0800, lists@lazygranch.com wrote:
>
> Hi there,
>
> > location / {
> > if ($badagent) { return 403; }
> > }
> > location = /feeds {
> > try_files $uri $uri.xml $uri/ ;
> > }
>
> > The "=" should force an exact match, but the badagent map is
> > checked.
> >
> > Absolutely the badagent check under location / is being triggered.
> > Everything works if I comment out the check.
> >
> > The URL to request the XML file is domain.com/feeds/file.xml .
>
> If the request is /feeds/file.xml, that will not exactly match
> "/feeds".
>
> location = /feeds/file.xml {}
>
> should serve the file feeds/file.xml below the document root.
>
> Or, if you want to handle all requests that start with /feeds/ in a
> similar way,
>
> location /feeds/ {}
>
> or
>
> location ^~ /feeds/ {}
>
> should do that. (The two are different if you have regex locations in
> the config.)
>
> f

There is a certain irony in that I first started out with
location /feeds/ {}
BUT I had the extra root statement. This appears to work. Thanks.

Here are a few tests:
claws rssyl plugin
200 xxx.58.22.151 - - [11/Jan/2019:03:48:25 +0000] "GET /feeds/feed.xml HTTP/1.1" 3614 "-" "libfeed 0.1" "-"

akragator
200 xxx.58.22.151 - - [11/Jan/2019:03:50:39 +0000] "GET /feeds/feed.xml HTTP/1.1" 3614 "-" "-" "-"

liferea
200 xxx.58.22.151 - - [11/Jan/2019:03:51:40 +0000] "GET /feeds/feed.xml HTTP/1.1" 3614 "-" "Liferea/1.10.19 (Linux; en_US.UTF-8; http://liferea.sf.net/) AppleWebKit (KHTML, like Gecko)" "-"

read on android
304 myvpnip - - [11/Jan/2019:03:55:44 +0000] "GET /feeds/feed.xml HTTP/1.1" 0 "-" "Mozilla/5.0 (Linux; Android 8.1.0; myphone) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/71.0.3578.99 Mobile Safari/537.36" "-"

feedbucket (a web based reader) They use a proxy
200 162.246.57.122 - - [11/Jan/2019:04:01:06 +0000] "GET /feeds/feed.xml HTTP/1.1" 3614 "-" "FeedBucket/1.0 \x5C(+http://www.feedbucket.com\x5C)" "-"


_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

I need my “bad user agent” map not to block my rss xml file

gariac January 08, 2019 10:32PM

Re: I need my “bad user agent” map not to block my rss xml file

Francis Daly January 09, 2019 03:20AM

Re: I need my “bad user agent” map not to block my rss xml file

gariac January 09, 2019 09:16PM

Re: I need my “bad user agent” map not to block my rss xml file

Francis Daly January 10, 2019 03:52AM

Re: I need my “bad user agent” map not to block my rss xml file

gariac January 10, 2019 11:08PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 304
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready