use the regex match of subdomain #169
Replies: 3 comments 2 replies
-
moved to discussion |
Beta Was this translation helpful? Give feedback.
-
You expect it to pass the matched group from the server and propagate to the destination, and this is not how it works because reproxy/app/discovery/discovery.go Line 181 in fa23778 The regex in the server name is to match multiple servers to the same rule. However, it has nothing to do with source-to-destination matching at all. Making a change to support it should be relatively easy, but I don't know if this is a good idea because it looks very confusing. It treats the server and source as a single regex for the destination but simultaneously as two distinct matching groups for the host and source. In addition to this confusion, we will need a way to enforce the current behavior (regex server match and substitution from src to dst) and ensure it doesn't break back compatibility. |
Beta Was this translation helpful? Give feedback.
-
with a static provider: reproxy --static.enabled --static.rule="example.com/api/(.*),https://api.example.com/$1" This was taken from the docs and is missing the host parameter, idk is it is a typo... maybe is the best solution also for backward compatibility: if host is missing (2 parameter instead of 3 splitted by the comma) use the 1st parameter to match also the host (and get the ability to use both group match in the destination) |
Beta Was this translation helpful? Give feedback.
-
i'm trying witouth success to proxy a range of subdomain to another host/path.. something like this
reproxy --static.enabled --static.rule="(.*).example.com,(.*),https://$1.foo.com/$2"
that should result in
http://AAAA.example.com/UUUU
proxied tohttps://AAAA.foo.com/UUUU
Is this possible somehow?
Beta Was this translation helpful? Give feedback.
All reactions