# [SOLVED] using apache proxy via dns subdomains

## tuner23

Hy,

i wonder if it is possible to forward http-requests with apache-proxy depending on the subdomains to different hosts.

e.g.

web.dns.org to 10.1.1.2

wiki.dns.org to 10.1.1.3

and maybe you can give some hints how to manage this?

thanks in advance,

antonios.Last edited by tuner23 on Tue Aug 02, 2011 6:23 pm; edited 1 time in total

----------

## kimmie

You need two virtual hosts... here's a starting point:

```
<VirtualHost *:80>

   ServerName web.dns.org

   <Location />

      ProxyPass http://10.1.1.2/

      ProxyPassReverse http://10.1.1.2/

   </Location>

</VirtualHost>

<VirtualHost *:80>

   ServerName wiki.dns.org

   <Location />

      ProxyPass http://10.1.1.3/

      ProxyPassReverse http://10.1.1.3/

   </Location>

</VirtualHost>
```

If you have trouble with the links in the proxied pages, you may also need to use mod_proxy_html to rewrite them... if so then make sure you're using version 3.0.1 because 3.0.0 was broke last time I checked.

----------

## tuner23

hy kimmie,

thank you for your answer.

Now it works (partially).

What i did:

1. I have enabled the use-flags (was also added before): proxy proxy_http 

2. My configuration:

```

<VirtualHost *:80>

   ServerName web.dns.org

   <Location />

      RewriteEngine On

      ProxyPass http://10.1.1.2/index.php/Main_Page

      ProxyPassReverse http://10.1.1.2/index.php/Main_Page

   </Location>

</VirtualHost> 

```

But now it's only HTML without the css-layout.

What is the problem for this? Did i missed some modules?

Or what else?

Hope someone can help me..

Thanks,

Antonios.

----------

## tuner23

Hy

now it works.

First i thought it was a problem with the firewall,

but i had to pass without the URL without the URL-path.. Like described above :-/

```

<VirtualHost *:80>

   ServerName web.dns.org

   <Location />

      RewriteEngine On

      ProxyPass http://10.1.1.2/

      ProxyPassReverse http://10.1.1.2/

   </Location>

</VirtualHost> 

```

Thanks for your help,

Antonis.

----------

## kimmie

np   :Smile: 

----------

