-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Support for path-based routing #1607
Conversation
@AlexanderLieret okay this looks promising, we've got only two failing tests. I've reset my local branch to your last commit and fixed an error I did on a merge conflict resolution. Next step is having nginx-proxy/docker-gen#343 merged then taking a look at the two failing tests. Given the radical changes this PR would make to nginx.tmpl, merging it will probably cause non trivial merge conflict on most if not all other feature PR. I have to think a bit about the best strategy for this, for now I came up with:
I'm leaning more toward 2. |
@buchdag I had a look at those failed tests. The first was the recent change of the CI test pipeline. Option 2 will push the merge conflicts to a later point. Being able to field test should be an advantage. |
So the sole failing test is:
Maybe tied to 343cdd0 ? |
Also I'm still not sure how I'll handle the final commit history that'll get merged. The current one, while keeping proper authoring credit for everyone's specific commits, is super messy and forces to merge the target branch back into the source branch. I'd like to avoid that if at all possible. I'm thinking about the following:
Each commit being authored by all the relevant contributors. |
This commit does break the test which is now failing. Its purpose is to test forced full regex matches instead of partial matches. The commit message does mention #124 which is superseded. This commit should be removed.
The main work was done by @gregsymons. The others and I rebased it on the current main branch and added some fixes. I added some QoL improvements to the "new" feature. Most of them were from the individual PRs and #254. |
This comment has been minimized.
This comment has been minimized.
3025551
to
6490246
Compare
I've cleaned up the commit history to get something a bit more legible and removed the code change that made the test fail. I haven't added back the support for custom location files per-VIRTUAL_HOST VIRTUAL_PATH yet. I noticed two things in the README history of this feature:
The part in bold does not work.
This doesn't work either. Both might have been working at the time their respective documentations were written then broken by subsequent commits. The first was directly tested in @gregsymons original tests. |
I will have another look at both problems. It seems like some features have been removed while rebasing on the current main. While improving the test cases I should move all virtual_path tests into a single directory. |
@AlexanderLieret let me know if you want me to merge this to the I'm not sold on the fact that the custom location files per-VIRTUAL_HOST VIRTUAL_PATH needs a |
@buchdag I have finished rebasing @gregsymons original commit to see if other stuff had been changed in the rebase chain. The new attempt is in a new branch. An updated documentation is needed. I have found a bug which prevents dockergen from updating the generated config file when another container is added to or removed from a domain. This could explain your failed attempts at manual testing. The currently failing test case is caused by this bug.
This sentence was added by @rodrigoaguilera and only works if the routable-path is not to be overwritten by the proxypass (
The hash is used to sanitize the A suitable default value for |
@KunalSolanke just to be sure: are you using the specific code from this PR ? It's based on but not the same as #599 |
@buchdag yeah ,initially I landed on that PR and tried that,but later found this one is the latest one so I tried this code from this one.Sorry for that.I later realized that the way I wanted this to work wouldn't be helpful rather the default behaviour is better .So you can safely ignore previous comment. |
Sorry for bothering again but I am stuck with another things again .This may require a bit of understanding of django. These are my django urls configuration.So the thing is Now the issue: when I do /test/debug(without end slash) nginx somehow redirects to /test/debug/ and I am sure this redirect is done by nginx and not by django. A basic sol for my problem would be to redirect everything from nginx to /uri to /uri/ ,but I have no idea how to do it here. This is autogenrated nginx.conf file
`` |
@KunalSolanke all of these redirect are done by your django application. With The only part I did see where Nginx propably was redirecting was something like |
@AlexanderLieret The reason why I said I am sure nginx is doing those redirects so requests don't even reach the target container in those cases. Ok now I know this might be naive observation, so there is middleware called commonMiddleware in django which handles these redirects, I just copied that middleware and made my own with debug statements and yeah the requests didn't reach there if I don't append slash.It might be so that my django application is indeed redirecting,I will try to debug more in my django app. Thanks for your reply😥😥. |
@buchdag I have finished redoing the commits. The new test cases are covering more parts of the code. Furthermore the documentation should be easier to read and contain more information. This is still in the new branch.
|
Co-authored-by: Josh Trow <josh.trow@gmail.com> Co-authored-by: Adrian <WolfspiritM@users.noreply.github.com> Co-authored-by: Rodrigo Aguilera <hi@rodrigoaguilera.net> Co-authored-by: Alexander Lieret <alexander.lieret@fau.de>
@buchdag I did split the commits into smaller ones. I am not sure what went wrong in your attempt. My branch |
@AlexanderLieret me neither, I'll try to clean this up based on your branch tomorrow. |
@AlexanderLieret PR merged to Thanks for the excellent work. |
Further tests and remarks / discussions in #1733 |
This is a work in progress combination of #599 + #1011 + #1083 + #1594 with proper authoring credits.
VIRTUAL_PATH
: route using this pathVIRTUAL_DEST
: rewrite the query path (optional)NOTE: This requires another pull request to function nginx-proxy/docker-gen#343 to function.