tomx
April 6, 2006, 4:49pm
1
Hello,
We have a webrick server running our nice app, and an apache server
being used to serve the rest of the site and act as a proxy for the
webrick app.
ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass /appname http://server.com:3000
ProxyPassReverse /appname http://server.com:3000
ProxyPreserveHost On
If you go to http://server.com/appname everything seem to work fine,
however when the app needs to redirect it strips the appname out of the
path. e.g. http://server.com/redirectcontroller/redirectaction
Apache gets all confused because it can’t find the file and returns a
404 error.
Does anyone know how to stop the /appname from being removed from the
URL?
Thanks
Tom
tomx
April 6, 2006, 5:27pm
2
On 4/6/06, Tom S. [email protected] wrote:
ProxyPass /appname http://server.com:3000
ProxyPassReverse /appname http://server.com:3000
ProxyPreserveHost On
Does anyone know how to stop the /appname from being removed from the
URL?
Couldn’t you change your proxy to use http://server.com:3000/appname
and then add “/appname” to your routes?
– James
tomx
April 6, 2006, 5:41pm
3
Couldn’t you change your proxy to use http://server.com:3000/appname
and then add “/appname” to your routes?
I’d rather avoid having the port in the path at all unless there is no
way around it.
How would I go about altering all routes to use a preset root directory
name?
Cheers
Tom
tomx
April 6, 2006, 6:01pm
4
On 4/6/06, Tom S. [email protected] wrote:
Couldn’t you change your proxy to use http://server.com:3000/appname
and then add “/appname” to your routes?
I’d rather avoid having the port in the path at all unless there is no
way around it.
I meant this:
ProxyPass /appname http://server.com:3000/appname
ProxyPassReverse /appname http://server.com:3000/appname
You were already using the port, so I didn’t think you wanted to get rid
of it.
How would I go about altering all routes to use a preset root directory
name?
Allow downloading Web Service WSDL as a file with an extension
instead of a file named ‘wsdl’
map.connect ‘appname/:controller/service.wsdl’, :action => ‘wsdl’
Install the default route as the lowest priority.
map.connect ‘appname/:controller/:action/:id’
I haven’t tried this, but I don’t see why it wouldn’t work either.
– James