From: Ron V. d. B. <ron...@ka...> - 2012-03-29 11:25:33
|
Hi all, I'm starting a new thread, since this specific problem was only sideways or partially mentioned in two other threads on this list: <http://markmail.org/message/ianhydc7hirr6s3n> and <http://markmail.org/thread/y7mh7flixdsjqx3c>. Basically, the problem is that when eXist is running on a port that is closed by the firewall, and accessed via reverse proxy behind an Apache HTTP server, all goes well, except for the webstart java client. Following the instructions from <http://exist-db.org/exist/production_web_proxying.xml#d43688e330>, I have set up following reverse proxy configuration in the httpd.conf file of an Apache server listening at <http://mydomain/>: ProxyRequests off ProxyPass/ http://localhost:8082/ ProxyPassReverse/ http://localhost:8082/ ProxyPassReverseCookiePath/ / This allows me to address e.g. <http://mydomain/exist/eXide/> successfully, which will be redirected to <http://mydomain/exist/eXide/index.html>. Yet, accessing the webstart client at <http://mydomain/exist/webstart/exist.jnlp> generates an exist.jnlp file which will try to connect to an eXist instance at <http://localhost:8082/exist/webstart.jnlp>, instead of <http://mydomain/exist/webstart.jnlp>. In short: the webstart client only sees the URL of the 'real' request; not the original request that is proxied. Meanwhile, I have found how this can be solved: Apache's mod_proxy module also has a ProxyPreserveHost directive, which will pass on the host of the original request to the proxied host (<http://httpd.apache.org/docs/2.2/mod/mod_proxy.html#proxypreservehost>). Adding this to the httpd.conf file: ProxyRequests off ProxyPreserveHost on ProxyPass/ http://localhost:8082/ ProxyPassReverse/ http://localhost:8082/ ProxyPassReverseCookiePath/ / ...makes everything work, including the webstart client. So far, so good. Yet, I don't want /all/ requests to be reverse proxied, but rather limit the proxying to requests starting with /apps/. Hence, I would like to proxy requests for <http://mydomain/apps/exist/eXide/> to <http://localhost:8082/exist/eXide/> (i.e. while an /apps/ path is in the request it should be filtered out from the proxied request): ProxyRequests off ProxyPreserveHost on ProxyPass/apps/ http://localhost:8082/ ProxyPassReverse/apps/http://localhost:8082/ ProxyPassReverseCookiePath/apps/ / This works well, except when redirections are at play: <http://mydomain/apps/exist/eXide/> is rewritten to <http://mydomain/exist/eXide/index.htm>. Note: this does not happen when the ProxyPreserveHost is switched off: in that case, <http://mydomain/apps/exist/eXide/> is successfully redirected to <http://mydomain/apps/exist/eXide/index.html>. I guess the same issue is at play with requests for the webstart client (with ProxyPreserveHost switched on): while an exist.jnlp file /is /generated, it will try to connect to <http://mydomain/exist/webstart/>, instead of <http://mydomain/apps/exist/webstart/>. I have the feeling I'm nearly there. Can anyone advice on the final fix? Kind regards, Ron |