Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

We have a few internal sites like sharepoint, bugzilla, an RoR server etc.The users access these sites through the URLs like, for example, abc.example.com, xyz.example.com and so on. Is it possible to configure so that instead of accessing the sites by abc.example.com and xyz.example.com, they can be accessed using URLs like example.com/abc and example.com/xyz? I thought this might be possible with reverse proxy, and have configured as below:

ProxyRequests off  
ProxyPass /abc http://abc.example.com
ProxyPass /xyz http://xyz.example.com
ProxyHTMLURLMap http://abc.example.com /abc
ProxyHTMLURLMap http://xyz.example.com /xyz
ProxyHTMLExtended On
ProxyHTMLLogVerbose On

<Location /abc>

ProxyPassReverse /
ProxyHTMLEnable On
ProxyHTMLURLMap / /abc/
ProxyHTMLURLMap /abc /abc
SetOutputFilter proxy-html
SetEnv proxy_html_force
SetEnv force-proxy-request-1.0 1
SetEnv proxy-nokeepalive 1
RequestHeader    unset  Accept-Encoding

</Location>

<Location /xyz>

ProxyPassReverse /
ProxyHTMLEnable On
ProxyHTMLURLMap / /xyz/
ProxyHTMLURLMap /xyz /xyz
SetOutputFilter proxy-html
SetEnv proxy_html_force
SetEnv force-proxy-request-1.0 1
SetEnv proxy-nokeepalive 1
RequestHeader    unset  Accept-Encoding

</Location>

But no matter what, I am not able to get it working. Apache logs indicate that it is a 404 error.I assume that I am getting it wrong in the 'Location' part, as /abc and /xyz are just random names, and do not point to any locations as such.

Is there any way that I can get it working, by using URL rewriting or something? Have also tried with Nginx, with no luck. Any help would be greatly appreciated.

Thanks, Mogaroy

share|improve this question

2 Answers 2

up vote 0 down vote accepted

I suspect that reverse proxy isn't what you're looking for, here, but rather something like RailsBaseURI. I haven't tried it yet as I'm using subdomains, but I remember reading that RailsBaseURI can be used in the Apache configuration of a host or virtual host. So for example.com/xyz, you'd presumably need something like:

ServerName example.com

RailsBaseURI /xyz

share|improve this answer

Thanks, Lime-Like, for pointing me in the right direction, and sorry for the delay in responding as I was on vacation.

Though not fully accurate, it helped me in moving in the right direction.As you suggested, I used the RailsBaseURI in the vhost section of my RoR server - had to create a symlink for it to work properly.This, along with some modifications to the reverse proxy configurations posted originally, has got it working successfully.

Now, all my internal sites can be accessed using a single URL, with different paths, except for the sharepoint server to which I am not able to get the authentication working through the proxy.It is configured to authenticate using NTLM, and that seems to have issues working through proxy.

Any pointers would be appreciated.Thanks again !!

Mogaroy

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.