Welcome! Log In Create A New Profile

Advanced

Re: Matching of special characters in location

Francis Daly
November 10, 2020 07:36PM
On Tue, Nov 10, 2020 at 02:54:26AM +0100, Grzegorz Kulewski wrote:
> W dniu 10.11.2020 o 01:19, Francis Daly pisze:

Hi there,

> > So my config file can include (e.g.)
> >
> > location ^~/<200b> { return 200 "match /zwsp ($uri, $request_uri)\n"; }
> >
> > (except there is only one "character" between the / and the space);
> > and then any request that starts with /%e2%80%8b should be handled in
> > that location; and any request that does not, should not be.
>
> Including raw UTF-8 special characters in nginx config isn't my ideal sane solution. :)

That's reasonable; but I think I'd disagree.

I'd suggest that if you can't write the character, you probably shouldn't
be using it in your web site such that it is needed in this part of the
config file :-)

> I think I would prefer to be able to use escapes in non-regexp matches too...

That's a reasonable preference. Current stock-nginx does not support it,
as far as I know. But you can add it yourself, if it is important enough.

If you can decide on an escape syntax that you like (and: most will
probably break some current valid config, so you'll want to choose one
that works for you), then you can either try to get the code to handle
it added to nginx; or (more likely, in the short term at least) you can
write a pre-processor for you that turns your nginx.conf.in (with escaped
characters in "location" values that start with something other than ~
or @) into an nginx.conf that includes the un-escaped characters in the
format that current-nginx will read.

Cheers,

f
--
Francis Daly francis@daoine.org
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Matching of special characters in location

Grzegorz Kulewski November 09, 2020 09:48AM

Re: Matching of special characters in location

Sergey A. Osokin November 09, 2020 03:12PM

Re: Matching of special characters in location

Grzegorz Kulewski November 09, 2020 06:12PM

Re: Matching of special characters in location

Francis Daly November 09, 2020 07:20PM

Re: Matching of special characters in location

Grzegorz Kulewski November 09, 2020 08:56PM

Re: Matching of special characters in location

Francis Daly November 10, 2020 07:36PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 183
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