sozu-proxy / sozu

Sōzu HTTP reverse proxy, configurable at runtime, fast and safe, built in Rust. It is awesome!
https://www.sozu.io/
GNU Affero General Public License v3.0
3.12k stars 193 forks source link

Redirect 301, 302, 308 #1009

Open beckend opened 1 year ago

beckend commented 1 year ago

Match URI, then redirect to another.

FlorentinDUBOIS commented 1 year ago

Hello, Could give us more details about what you want to achieve and your need?

beckend commented 1 year ago

here is something from envoy, I hope this is clear

                "route_config": {
                  "name": "local_route",
                  "virtual_hosts": [
                    {
                      "name": "all-international",
                      "domains": ["sang.international","*.sang.international"],
                      "routes": [
                        {
                          "match": {
                            "prefix": "/"
                          },
                          "redirect": {
                            "host_redirect": "sang.agency"
                          }
                        }
                      ]
                    }
                  ]
                },
Walker-00 commented 4 months ago

@FlorentinDUBOIS I think it's something like matching subdomain request and route to the specific port or url, and I also needing that

FlorentinDUBOIS commented 1 month ago

Sorry for the late response, I miss the notification. So, we already have implemented the wildcard matching pattern using or not path prefix, equals or regex. However, we do not have a redirect feature yet.

FlorentinDUBOIS commented 1 month ago

@Wonshtrum is the redirect feature easy to implement?

Walker-00 commented 1 month ago

should implement that feature, waiting for it.

Wonshtrum commented 1 month ago

The redirection itself is quite straightforward, but I'm not quite sure about the integration with the tooling: command line, config.toml, protobuf messages... We should also decide what exactly are the capabilities of this feature. I don't know how it is done in other reverse proxies, but can we only change the authority? Should we be able to change the path? Is it a simple replacement or should we handle wildcards (*.domain.com -> *.domain2.com), if so what about regexes?