-
-
Notifications
You must be signed in to change notification settings - Fork 118
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
Question regarding path - Maybe stupid, but I would need some help #134
Comments
What you want would require revproxy parse the response from the server and translate links such as I think this might be the rewrite feature. Never used it myself, so not sure what it does exactly. See https://django-revproxy.readthedocs.io/en/latest/proxyview.html#revproxy.views.ProxyView.rewrite |
Hello brianmay, Thank you for your fast answer, I appreciate it. |
Depends on your use case. For me I only ever used it once (in an application that was cancelled during development) to proxy 3rd party APIs and bypass JavaScript CORS restrictions, so I never needed any rewriting abilities in any direction. Maybe this was never implemented. In which case the documentation should perhaps be clarified as to what "Basic URL rewrite" means. |
If someone fall here, I've managed to handle that case.
You can find a Mixin to implement this behavior here: https://gist.github.com/fabien-michel/dfc7105e87d8c89b646da7a0483657d9
The same gist contain other useful mixins to handle root url in Location header (redirect) and to clear sessionid cookie so a remote proxified django doesn't logout current user because of cookie forwarding |
Hello,
Thank you for all the effort to make this works.
I have the revproxy inside a view at www.mysite.com/proxy/.
The problem I see is that in the responses the /proxy/ part is not added.
Test bed (example):
In this case, the upstream could be: www.google.com
So, for example, if a request goes to www.mysite.com/proxy/, it is translated to www.google.com, but in the response the url of the image that should be loaded (www.google.com/images/this_image.jpg) becomes www.mysite.com/images/this_image.jgp; instead of www.mysite.com/proxy/images/this_image.jgp. So, It does not work at all.
I hope to be clear. I read all questions done before, but I did not understand how to fix this.
A second question. Is there any way to add the IP address to the upstream plus the URL? I mean, in order to avoid DNS or etc/hosts to resolve it.
Thanks, I appreciate any help.
M
The text was updated successfully, but these errors were encountered: