[NTLUG:Discuss] Apache reverse proxy question

Stuart Johnston saj at thecommune.net
Thu Jun 5 16:33:30 CDT 2008


Craig Gill wrote:
> I need alittle help configuring apache reverse proxy.
> 
> Apache 2.2.4 on port 80
> Lighttpd 1.4.18 on port 81
> 
> I'm trying have http://media.xyz.com/ proxy to
> http://proxiedsite.com:81/ on the same box, but apache has 1 virtual
> host already running http://www.xyz.com, is it possible to proxy just
> the media.xyz.com only or could somebody provide a config example?
> I've looked at the apache proxy doc's but it doesn't mention this
> scenario.  I don't want media.xyz.com to interfere with the
> www.xyz.com site.
> http://httpd.apache.org/docs/2.2/mod/mod_proxy.html
> 
> 
> NameVirtualHost *:80
> <VirtualHost _default_:80>
> DocumentRoot "/web/Sites/xyz"
> ServerName www.xyz.com
> ServerAlias xyz.com
> LogLevel emerg
> Include xyz_log
> DirectoryIndex index.html index.htm index.php
> </VirtualHost>
> 
> 
> In the proxy.conf I know I need at minimum:
> 
> ProxyRequests Off
> ProxyPass / http://0.0.0.0:81/
> ProxyPassReverse / http://0.0.0.0:81/
> 
> The whole subdomain part is whats throwing me off.
> 
> Any suggestions?

Just create a virtualhost section for the subdomain:

<VirtualHost _default_:80>
   ServerName media.xyz.com

   ProxyPass / http://0.0.0.0:81/
   ProxyPassReverse / http://0.0.0.0:81/
</VirtualHost>



More information about the Discuss mailing list