Welcome! Log In Create A New Profile

Advanced

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

Francis Daly
January 10, 2019 03:52AM
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
--
Francis Daly francis@daoine.org
_______________________________________________
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: 233
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