Am 25.06.2012 12:11, schrieb ArtemGr: > ArtemGr<artemciy@...> writes: >> Problem using the proxy with a custom port: >> >> <mapurl> >> <url>^/(.*)$</url> >> <target>proxy<at> tntnet</target> >> <args><arg>http://myhost:12080/$1</arg></args> >> </mapurl> >> >> gives "Error/Not Found", whereas >> >> <mapurl> >> <url>^/(.*)$</url> >> <target>proxy<at> tntnet</target> >> <args><arg>http://myhost/$1</arg></args> >> </mapurl> >> >> works. >> >> I'd think custom ports are important if tntnet to be used as a front-end: >> there's often several back-ends working on different ports. > After some experimentation with tntnet proxy I've figured > that the "$1" is not supposed to be there, > since proxy always adds the current path into the url anyway: > > url += request.getPathInfo(); > > Also, the proxy is currently broken for me because > > std::string url = uri.path(); > url += request.getPathInfo(); > > produces a double-slash when getting the root page (e.g. http://myhost/), > turning http://myhost/ into http://myhost//. > > Here is a patch fixing some of these: https://gist.github.com/2987769 Thank you for the patch. I changed it a little.
Not that pathinfo do not need to have a '/' as a first character. You can set the path info in the configuration. Add <pathinfo>$1</pathinfo> into the mapping above and it gets the path without the trailing '/'. The proxy module now handles both cases (double slash and no slash) correctly. And the custom port works here as expected. Tommi ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Tntnet-general mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/tntnet-general
