Closed ai closed 7 months ago
Nice way. I'm surprised that RegExp.source
works in Nginx without any modification :)
However regexp flags are not exported and final rules will be case-sensitive. To make them case-insensitive (as in nanostores/router
) Nginx location can be definded this way:
location ~* __ROUTES__ {
#...
}
Regular expressions are specified with the preceding “\~*” modifier (for case-insensitive matching), or the “~” modifier (for case-sensitive matching) https://nginx.org/en/docs/http/ngx_http_core_module.html#location
Motivation
The new way is simpler and should be faster.
Script now exports a single RegExp, which we insert to
nginx.conf
inDockerfile
.cc @easing