Take the 2-minute tour ×

I'm running VirtualBox on OSX host with Debian guest. I use Debian to run my development LAMP environment and I would like all traffic on my host port 80 to be automatically forwarded to the Debian guest.

Currently my debian server is set up with 2 network adapters, one Host-Only and one NAT (the latter simply to give it an internet connection, it's not meant for server duty).

On my OSX host I've configured mod_proxy like so:

ProxyPass / http://debian/

(debian being the hostname of the debian guest). This works for me as my host shares an internal network with "debian", however if I quickly want to show something to a collegue and send them my url (192.168, etc) then they won't be so lucky.

How can I set up my configuration in such a way that my OSX apache server basically acts as a full on proxy solution for my debian server?


share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

If I'm reading your question correctly, it sounds as though you understand ProxyPass to work similar to an HTTP 301/302 status, which is incorrect. A 302 HTTP status will say to the requesting client, "Hey, get this from some other address yourself." In this case, debian would have to be visible to your colleague.

However, ProxyPass (and reverse proxies in general) make the connection for you; the client doesn't need to (and very often doesn't) have direct access to the upstream server, in this case debian. Long story short, unless I'm reading this wrong, you should be good already, as long as Apache on your host machine (your physical box) is listening on an IP address they can see.

share|improve this answer
Fact is though that I'm not. The first page I get to works fine but subsequent url's linked from that page go to debian, and not the url that was given in the url bar (ie. links that are relative). –  Naatan Aug 16 '12 at 15:13
I found the problem, the application I was testing added a <base href=..> element which was detected based on the url used to access the page. All relative url's are relative to this element's href value so that's what was causing my issue. I will mark your answer as the correct one as I realize my question was not properly formulated and yours was in fact answering the question as it came across. –  Naatan Aug 16 '12 at 15:43
Ahaaaa, that'll do it. Out of curiosity, what application was adding <base> elements? –  Marc Bollinger Aug 16 '12 at 19:10
XenForo, bulletin board.. –  Naatan Aug 17 '12 at 13:10
add comment

Your Answer


