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.

This is the situation:

Server A hosts "http://internal.intranet"

Server B hosts the internal application on "http://servernameb.intranet/foo/bar"

Server A needs to redirect all incoming http trafic to the adress of server B without users noticing it.

I can easly do this with the following config file:

<VirtualHost 10.0.4.26>
  ServerName internal.intranet
  ServerAlias internal

  RewriteEngine on

  # Deny TRACE/TRACK request methods
  RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)
  RewriteRule .* - [F]

  #RewriteRule "^/files(.*)$" "/files$1" [L]

  # Everything else not matched above needs to go to the servlet container
  # via HTTP listening on port 8008. The [P] flag (which is required)
  # implies that our requests will be handled by mod_proxy.
  RewriteRule "^/(.*)" "http://servernameb.intranet:8080/foo/bar/$1" [P]
</VirtualHost>

But then the problem is that the url shown in the users browser is: http://servernameb.intranet..... instead of http://internal.intranet

I don't want the users to get in contact with the servernameb address.

I know I probably need to use ProxyPass and ProxyPassReverse but i just can't get it to work.

share|improve this question

1 Answer 1

you should try the following:

<VirtualHost 10.0.4.26>
  ServerName internal.intranet
  ServerAlias internal

  ProxyPass        /  http://servernameb.intranet/foo/bar/
  ProxyPassReverse /  http://servernameb.intranet/foo/bar/
</VirtualHost>
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.