django-revproxy icon indicating copy to clipboard operation
django-revproxy copied to clipboard

Redirects not handled correctly

Open anthonysutardja opened this issue 9 years ago • 5 comments

301 Redirects by the upstream server causes the proxied url to redirect to the upstream path, rather than the proxied path + upstream path.

anthonysutardja avatar Nov 19 '15 18:11 anthonysutardja

My upstream server automatically requires most URLS to end with a trailing slash /api/jellos/ (as opposed to /api/jellos and issues a 301

My temporary fix is to use the built in regex rewrites that are built-in with this package:

from revproxy.views import ProxyView
class JelloProxyView(ProxyView):
    upstream = 'http://jello:8080'
    rewrite = (
        (r'^(?P<base>.*)(?<!/)$', r'\g<base>/'),
    )

anthonysutardja avatar Nov 19 '15 19:11 anthonysutardja

Thanks for the report @anthonysutardja! I'm a bit busy lately so if you could write a test to reproduce your problem it would be very helpful. Let me know if you need some guidance. Thanks again!

seocam avatar Nov 19 '15 21:11 seocam

Hello @anthonysutardja I want to address that before 0.9.8. I little help would be really appreciated! Cheers!

seocam avatar Dec 03 '15 20:12 seocam

Closed for lack of info.

seocam avatar Mar 29 '16 20:03 seocam

Same bug here :( Instead of page being loaded I get 301 redirect to an upstream url. Try with domain https://15min.lt as an upstream.

toinbis avatar Apr 08 '20 07:04 toinbis