Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have two Apache Servers with mod_proxy enabled. I want to know how to "pass the request" from "Apache Server A" to "Apache Server B" using the same port (80).

In "server A" with internal ip: I have configured DNS and I am also using it as my mail server.

In "server B" with internal ip: I have my own cloud server.

Today when I access or everything works because the content is all in "server A", what I need is when somebody tries to access they can access my server B without redirecting them to another port like, I just want to use port 80.

Actually I get a redirect loop because when I try to redirect I guess "SERVER A" is getting the same request by himself. I have set my virtualhost working in the same "SERVER A" what I want is to "redirect" to another server using the same port and URL (

I don't want to redirect using another port.

share|improve this question
Example from Atlassian… – Jenechka Sep 7 at 9:52

1 Answer 1

up vote 6 down vote accepted

You're going to want to do something like this on Server A:

NameVirtualHost *
<VirtualHost *>

    ProxyRequests Off
    <Proxy *>
        Order deny,allow
        Allow from all

    ProxyPass /
    ProxyPassReverse /
    <Location />
        Order allow,deny
        Allow from all

Depending on your application you may need to make use of one or all of the following:

  • X-Forwarded-For - The IP address of the client.
  • X-Forwarded-Host - The original host requested by the client in the Host HTTP request header.
  • X-Forwarded-Server - The hostname of the proxy server.

Take a look at the mod_proxy documentation for more tips and tricks.


share|improve this answer
It works. But i have another trouble, the owncloud server is in, how can i "redirect" to that path /owncloud. Now i have this in my server A: RewriteCond %{HTTP_HOST} ^owncloud\.mydomain\.com$ [NC] RewriteRule ^/(.*)$$1 [P] How can i redirect to /owncloud THanks – maxtorzito May 27 '13 at 15:47
I'd ask it as another question. – slm May 27 '13 at 15:50
Here you have the question:… – maxtorzito May 27 '13 at 16:20
Thanks to @slm this is working. – maxtorzito May 27 '13 at 16:21

Your Answer


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.