implement path replacing option

This commit is contained in:
Jun Kurihara 2022-07-26 20:58:18 +09:00
commit a0aed6d848
No known key found for this signature in database
GPG key ID: 48ADFD173ED22B03
9 changed files with 89 additions and 56 deletions

View file

@ -56,6 +56,12 @@ upstream_options = ["override_host"]
# Non-default destination in "localhost" app, which is routed by "path"
[[apps.localhost.reverse_proxy]]
path = '/maps'
# For request path starting with "/maps",
# this configuration results that any path like "/maps/org/any.ext" is mapped to "/replacing/path1/org/any.ext"
# by replacing "/maps" with "/replacing/path1" for routing to the locations given in upstream array
# Note that unless "path_replaced_with" is specified, the "path" is always preserved.
# "path_replaced_with" must be start from "/" (root path)
replace_path = "/replacing/path1"
upstream = [
{ location = 'www.bing.com', tls = true },
{ location = 'www.bing.co.jp', tls = true },