Skip to content Skip to sidebar Skip to footer

Cherrypy.HTTPRedirect Redirects To IP Instead Of Hostname Using Abs Path

I'm running CherryPy behind nginx and need to handle redirects. On my dev machine running on 127.0.0.1:8080, this redirects correctly to 127.0.0.1:8080/login. However when running

Solution 1:

Try tools.proxy config setting:

'tools.proxy.on': True,

Additionally you may need

'tools.proxy.local': 'X-Forwarded-Host',

Set to appropriate header. When using NGINX, the header would be

'tools.proxy.local': 'Host',

In case of Lighttpd this header will be appropriate:

'tools.proxy.local': 'X-Host'

Solution 2:

I couldn't add a comment to the https://stackoverflow.com/a/20730038/1115187 , but I know, that Lighttpd sends X-Host header, so for Lighttpd proxy use:

'tools.proxy.local': 'X-Host'

Post a Comment for "Cherrypy.HTTPRedirect Redirects To IP Instead Of Hostname Using Abs Path"