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
rewrite: Add client-side redirect support #1750
Conversation
This adds a new "redirect" directive to the complex rewrite directive. Providing an HTTP response code will force Caddy to issue an HTTP redirect instead of internally rewriting the request. Fixes caddyserver#1749, caddyserver#726, caddyserver#856
That was quick! Thanks :-) Before the people "in charge" get in here, I noticed a few things that might be worth thinking about:
I don't intend any of this as negative criticism, just things that I think are worth having thought about before the change is finalized. |
|
Hey Andrew, thanks so much for taking the time to implement this. I have a few reservations, but nothing we can't work through. I really don't believe the rewrite middleware should be issuing redirects. This behavior is confusing. Do we just need regular expression matching for |
I chose to implement this as a part of the I wouldn't have an issue with refactoring |
Okay. If my understanding is correct that all Want me to leave this PR open in the meantime? |
Indeed, what I had in mind when proposing the feature request was to either give Sharing the request-matching code (regexp and conditionals) between |
@mholt I'll probably open another PR for this. For the moment, I'd like it if this PR stayed open until I can open a new one. |
Sounds good, consider this your active TODO item. Thanks for tackling this!! ❤️ |
Going to check in: I've been busy with other things, which has understandingly limited my ability to work on this. I will hopefully be able to start working on the refactor this week. |
Thanks for the check-in. We appreciate it! (Likewise, I have a state holiday tomorrow so I'm off. 😄) |
Hey @astei - just checking in. Let us know if you need help and would like someone else to finish this up... |
I have moved into my dorm to start classes in a few days and don't have my computer yet. I will have it tomorrow.On Aug 4, 2017 9:03 PM, Matt Holt <notifications@github.com> wrote:Hey @astei - just checking in. Let us know if you need help and would like someone else to finish this up...
—You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub, or mute the thread.
|
Ah, I know how that goes. Good luck with the transition! |
I finally have a little time to work on this. |
Great 😄 Looking forward to it. |
I think it's been long enough that perhaps we should close this for now. Much has changed in the last few months, including #1948, which might alleviate the need for these changes. Feel free to comment if this PR needs further discussion or another look, just closing to clear out my TODO list. Thanks! |
1. What does this change do, exactly?
This adds a new "redirect" directive to the complex rewrite directive. Providing an HTTP response code will force Caddy to issue an HTTP redirect instead of internally rewriting the request.
2. Please link to the relevant issues.
#1749, #726, #856
3. Which documentation changes (if any) need to be made because of this PR?
Information about the new
redirect
directive should be added to https://caddyserver.com/docs/rewrite.4. Checklist