parsing of the Host header and proxy
Hi. I'm using nginx as a proxy server. It's mod_proxy is very good, so I do not have to use all the VHostMonster (ugly) stuff. However there is a problem with the parsing of the Host header: Twisted Web only parses the host name and not the port. This means that, as an example, when I use request.prePathURL, I got the wrong port. I have written a patch where I define a new getRequestHost method in the Request object, that returns a tuple (host, port), and a modified version of _prePathURL that uses the new method. However I'm not sure if I shoulf fill a ticked. Nobody else has the same problem? Thanks Manlio Perillo
Manlio Perillo ha scritto:
Hi.
I'm using nginx as a proxy server. It's mod_proxy is very good, so I do not have to use all the VHostMonster (ugly) stuff.
However there is a problem with the parsing of the Host header: Twisted Web only parses the host name and not the port.
This means that, as an example, when I use request.prePathURL, I got the wrong port.
I have written a patch where I define a new getRequestHost method in the Request object, that returns a tuple (host, port), and a modified version of _prePathURL that uses the new method.
I just noticed that the current implementation does not work for Unix sockets. My implementation still does not support Unix Socket, but this is a concern only if the Host header is not set (but nginx returns a 400 Bad Request, in this case). I will fill a ticket. Regards Manlio Perillo
participants (1)
-
Manlio Perillo