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
https://forums.phpfreaks.com/topic/106909-how-to-virtualhost-a-reverseproxy/
Share on other sites

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

 

<VirtualHost *:80>
    ServerAdmin [email protected]
    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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.