0

I'm configuring tomcat to forward visitors to a different domain and different port using the tomcat http connector, and proxy settings in the apache site config (as explained here).

A more specific explanation: - I'm running a web app 'yasgui' on domain1.org:8080/yasgui - I'm forwarding it using a http connector to domain2.org/yasgui by configuring the connector like this:

 <Connector port="8080" protocol="HTTP/1.1"
           connectionTimeout="20000"
           redirectPort="8443"
           proxyName = "domain2.org"
           maxPostSize = "0"
           proxyPort = "80" 
    /> 

and adding this to the site config of domain2.org:

ProxyVia On
ProxyPass /yasgui http://domain2.org:8080/yasgui

This works perfectly fine when I visit http://domain1.org:8080/yasgui , which gets forwarded to http://domain2.org/yasgui. However, this link does not work: http://domain1.org:8080/yasgui/ (notice the trailing slash). This link shows the page as-is on domain1.

I'm not sure where the error is here: the apache config or the tomcat config. Help is much appreciated!

  • Can't you just put a / at the end of the proxy configuration? – Snowburnt Apr 08 '13 at 16:26
  • doesnt work as well... I've put a trailing slash in the proxy config (i.e. http://domain2.org:8080/yasgui/ . When visiting http://domain1.org:8080/yasgui/ , I still won't get forwarded to either http://domain2.org:8080/yasgui/, or http://domain2.org/yasgui – Laurens Rietveld Apr 19 '13 at 08:45

1 Answers1

0

Please fix your Apache configuration. Please add

ProxyPassReverse  /app http://localhost:8080/app 
Michael
  • 597
  • 3
  • 9
  • 23
  • Added this to my apache config to no avail. The trailing slash problem persists.. ps. is the 8081 port a typo? (tried config with both 8080 and 8081 ports) –  Apr 06 '13 at 11:59
  • yes, it was typo. Any case the configuration should be fixed. Also, probably app is "yasgui". Correct? Can you open the URL directly? http://domain2.org:8080/yasgui/ – Michael Apr 06 '13 at 15:45
  • Yes, opening both domain2.org:8080/yasgui and domain2.org/yasgui/ works fine.. (ps. changed app name (yasgui) properly in starting post) – Laurens Rietveld Apr 08 '13 at 16:19