Apache as proxy for webrick

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

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

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

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

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs