Jump to content

How to VirtualHost a ReverseProxy?


xqwertyx

Recommended Posts

I have 2 machines 1 server, 1 workstations and a DNS(www.sigenaulit.com) who is pointing to server 1.

 

machine 1  : www.walangalam.com

  machine 2 IP: 192.168.0.2

 

using reverseproxy i have the www.walangalam.com/yw working with a (www.walangalam.com apache)config of:

 

 

ProxyPass /yw http://192.168.0.2/yw

  ProxyPassReverse /yw http://192.168.0.2/y

w

 

My problem now is how can I publish http://192.168.0.2/yw from www.sigenaulit.com?

 

I tried a lot of format in <VirtualHost> but it still not working, and I can't find threads to solve the problem.

 

Link to comment
Share on other sites

You could easily do this with a rewrite rule like this:

 

<VirtualHost *:80>
    ServerAdmin you@domain.com
    DocumentRoot /path/to
    ServerName domain.com
    RewriteEngine On
    RewriteCond {REQUEST_URI} !-f
    RewriteRule ^/(.*) http://somedomain.tld/$1 [P,L]
</VirtualHost>

 

That would proxy all requests that are not valid files on the domain.com to somedomain.com

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.