定义匹配类似的位置指令的最有效方法是什么?
location = /[0-9a-zA-Z_-]{1,6} { content_by_lua_file ....}
Run Code Online (Sandbox Code Playgroud)
换句话说,URI匹配1到6个字符的字符串,带有" - ","_",数字和字母.
或者在我的LUA代码中检查字符串长度是否更快,这将通过使用类似的位置指令生成输出
location / {content_by_lua_file...}
Run Code Online (Sandbox Code Playgroud)