码迷,mamicode.com
首页 > Web开发 > 详细

apache 正向代理反向代理

时间:2016-01-18 20:58:50      阅读:297      评论:0      收藏:0      [点我收藏+]

标签:代理服务器   局域网   internet   common   

<VirtualHost *:80>
    ServerAdmin 523775@qq.com
    DocumentRoot "/var/www/html/"
    ServerName www.test.com
    ServerAlias test.com
    ErrorLog "logs/test.com-error.log"
    CustomLog "logs/test.com-access.log" common    
    Alias /html "/var/www/html/"

    <Directory "/var/www/html/">
        Options FollowSymLinks
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>
    
    #正向代理设置,internet选项---连接---局域网设置---代理服务器--填写www.test.com
    ProxyRequests On
    ProxyVia On

    <Proxy *>
        Order deny,allow
        Deny from all
        Allow from 10.0.0.1/8
    </Proxy>
</VirtualHost>

<VirtualHost *:80>
   ServerAdmin 523775@qq.com
   DocumentRoot "/var/www/html/"
   ServerName www.abc.com
   ServerAlias abc.com
   ErrorLog "logs/abc.com-error.log"
   CustomLog "logs/abc.com-access.log" common    
   Alias /html "/var/www/html/"
   <Directory "/var/www/html/">
        Options FollowSymLinks
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>
    
    #反向代理设置
    ProxyPass / http://www.test.com/
    ProxyPassReverse / http://www.test.com/

</VirtualHost>

本文出自 “freeterman” 博客,请务必保留此出处http://myunix.blog.51cto.com/191254/1736228

apache 正向代理反向代理

标签:代理服务器   局域网   internet   common   

原文地址:http://myunix.blog.51cto.com/191254/1736228

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!