apache 正向代理反向代理

简介:

<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 51CTO博客,原文链接:http://blog.51cto.com/myunix/1736228,如需转载请自行联系原作者

相关文章
|
Web App开发 应用服务中间件 Apache
Apache HTTP配置反向代理入门
Apache HTTP配置反向代理入门 反向代理(Reverse Proxy)方式是指以代理服务器来接受internet上的连接请求,然后将请求转发给内部网络上的服务器或者外部网络上其它IP地址服务器,并将从服务器上得到的结果返回给internet上请求连接的客户端,此时代理服务器对外就表现为一个服务器。
1980 0
|
11月前
|
域名解析 缓存 应用服务中间件
Nginx反向代理网站,不带www访问域名,竟然返回了Hello Apache!
Nginx反向代理网站,不带www访问域名,竟然返回了Hello Apache!
336 0
|
缓存 算法 应用服务中间件
[Apache,反向代理,日志,默认值,HTTP]Nginx日志配置详细教程
  nginx日志配置   nginx有一个非常灵活的日志记录模式。每个级别的配置可以有各自独立的访问日志。日志格式通过log_format命令来定义。ngx_http_log_module是用来定义请求日志格式的。   access_log指令   access_log path [format [buffer=size [flush=time]]];   access_log path format gzip[=level] [buffer=size] [flush=time];
400 0
|
负载均衡 网络协议 关系型数据库
通过Nginx TCP反向代理实现Apache Doris负载均衡
Nginx能够实现HTTP、HTTPS协议的负载均衡,也能够实现TCP协议的负载均衡。那么,问题来了,可不可以通过Nginx实现Apache Doris数据库的负载均衡呢?答案是:可以。接下来,就让我们一起探讨下如何使用Nginx实现Apache Doris的负载均衡。
354 0
|
应用服务中间件 Apache nginx

热门文章

最新文章

推荐镜像

更多