We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
如下:在nginx中,路径匹配只需正则解析一次,获取的变量($path)可以在location块中使用
location ~ ^/api/(?<path>.+)$ { proxy_pass http://$path/interface/$path; }
目前pingap配置如下:复杂的地址重写似乎要给出相同的正则解析,解析出的path变量只能rewrite中使用
[locations.api] enable_reverse_proxy_headers = true path = "~ ^/api/\\w{5,12}$" # 有的路径匹配必须用正则 rewrite = "^/api/(?<path>\\w{5,12})$ /interface/$path" # 这里也要用相同的正则解析路径 upstream = "path“ # 目前upstream还无法使用$path变量
期望的效果如下:
[locations.api] enable_reverse_proxy_headers = true path = "~ ^/api/(?<path>\\w{5,12})$" rewrite = "/interface/$path" upstream = "$path“
The text was updated successfully, but these errors were encountered:
feat: path rewrite and upstream support variables, #104
3786735
@imxxiv upstream 与rewrite均可以使用变量指定,可以使用最新构建的docker镜像测试。
Sorry, something went wrong.
vicanso
No branches or pull requests
如下:在nginx中,路径匹配只需正则解析一次,获取的变量($path)可以在location块中使用
目前pingap配置如下:复杂的地址重写似乎要给出相同的正则解析,解析出的path变量只能rewrite中使用
期望的效果如下:
The text was updated successfully, but these errors were encountered: