On Mon, Apr 12, 2021 at 12:02:32PM +0200, Artur wrote:

Hi there,

> This seems to work :
> 
> rewrite "^/((?:[a-zA-Z0-9]+(?:[-][a-zA-Z0-9])*)+)$"
> /index.php?short_name=$1 last;
> 
> However, I suppose there is no way to check the size of $1 here.

So far, it looks like you want to allow either:

* 1 letter-or-number

or

* 1 letter-or-number, then 0-to-30 letter-or-number-or-hyphen, then
1 letter-or-number

and it's probably simplest to do that as two separate "rewrite" rules.

Good luck with it,

        f
-- 
Francis Daly        fran...@daoine.org
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx

Reply via email to