Home » Odeon Blogs » Stefan Talpalaru, CTO »

Django redirects in reverse proxy setups

Django redirects in reverse proxy setups

Starting with django-1.3.1 you'll get redirect failures for reverse proxy setups (cherokee and cherrypy in my case). The reason is that relative paths that you feed to HttpResponseRedirect are converted into absolute URLs using META['HTTP_HOST'] which is actually the IP of the reverse proxy. To fix this add the following line to settings.py:

  1. USE_X_FORWARDED_HOST = True
More details in the release notes.


Category: Django

Discussion

  1. Very easy to fix. Thanks :D




Leave a Comment :

(required)


(required)




(required)




(required)






Leave a Comment


Page generated in: 0.15s