Comment 1 for bug 1168243

Revision history for this message
Sergej Nikolaev (kinolaev) wrote :

Hello! Big thank for you solution and I found how make it with only one line in wsgi_server.py:

def application(environ, start_response):
    if config['proxy_mode'] and 'HTTP_X_FORWARDED_HOST' in environ:
+ werkzeug.serving.WSGIRequestHandler.address_string = lambda self: self.headers.get('x-real-ip', self.client_address[0])
        return werkzeug.contrib.fixers.ProxyFix(application_unproxied)(environ, start_response)
    else:
        return application_unproxied(environ, start_response)