Skip to content
New issue

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

dynamically configure Redirects in Routes? #2576

Open
3 tasks done
burtonrodman opened this issue Aug 19, 2024 · 4 comments
Open
3 tasks done

dynamically configure Redirects in Routes? #2576

burtonrodman opened this issue Aug 19, 2024 · 4 comments
Labels
needs-author-action An issue or pull request that requires more info or actions from the author. Type: Feedback This issue is general feedback and doesn't represent actionable work.

Comments

@burtonrodman
Copy link

burtonrodman commented Aug 19, 2024

Some details

Hello, my question is this:
I realize that YARP is meant for proxying, not redirecting, but YARP does provide an elegant dynamic configuration system that is not default to .Net Core's Redirect setup... ie dynamically configuring Redirects in .Net Core is hard 😢

I looked at the YARP route configuration and didn't see any notion of Redirects.
My current application has a table of Redirects that get configured on startup, but they are not dynamic -- ie if they change in the database we have to restart the site.

As a part of a rewrite of our app we're using YARP to proxy some pages to the new site and some to the old.

However, given that my YARP project now effectively provides a nice "pinch point" for all things route(ish), it seems like a good place to also handle general redirects in a more dynamic way.

Is there anything built-in that I'm missing, or can you point me to any examples that I could use to come to a solution for dynamically configurable redirects.

For some background, an example redirect is a feature of the old site that we're deprecating now should be redirected to the homepage.

How many backends are in your application?

  • 1-2

How do you host your application?

  • Azure App Service
  • Azure Container Apps
@burtonrodman burtonrodman added the Type: Feedback This issue is general feedback and doesn't represent actionable work. label Aug 19, 2024
@Tratcher
Copy link
Member

You're right that this isn't natively supported, but you could add it with custom transforms keyed from config.
https://microsoft.github.io/reverse-proxy/articles/transforms.html#extensibility
#1923

@karelz
Copy link
Member

karelz commented Aug 27, 2024

@burtonrodman did you look at the above? Is it sufficient for you?

@burtonrodman
Copy link
Author

sorry, haven't had a chance to look back at this. will do asap.

@karelz
Copy link
Member

karelz commented Sep 10, 2024

@burtonrodman do you have rough ETA when it might be good time to check out the answer?
Or should we close it as resolved and let you reopen if you find more problems / questions later?

@MihaZupan MihaZupan added the needs-author-action An issue or pull request that requires more info or actions from the author. label Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-author-action An issue or pull request that requires more info or actions from the author. Type: Feedback This issue is general feedback and doesn't represent actionable work.
Projects
None yet
Development

No branches or pull requests

4 participants