Created
February 3, 2012 19:38
-
-
Save njvack/1731959 to your computer and use it in GitHub Desktop.
Trivial fix for HTTP_HOST problems with reverse-proxied Django
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Simply copies the X_FORWARDED crap into HTTP_HOST and SERVER_NAME. | |
""" | |
class SetHostname(object): | |
def process_request(self, request): | |
request.META['HTTP_HOST'] = request.META['HTTP_X_FORWARDED_HOST'] | |
request.META['SERVER_NAME'] = request.META['HTTP_X_FORWARDED_SERVER'] | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment