apache 正向代理反向代理

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

你可能感兴趣的:(代理服务器,internet,common,局域网)