apache反向代理,动静分离

- ProxyPass /upload !  #不走代理,虚拟主机自己处理,对应路径DocumentRoot目录下

-  ProxyPass /photo !

-  ProxyPass /*.jpg !

-  ProxyPass /*.gif !

-  ProxyPass /*.png !

-  ProxyPass /*.jpeg !

- ProxyRequests Off

- ProxyPass   /  balancer://125home/ lbmethod=byrequests stickysession=JSESSIONID nofailover=Off timeout=5 maxattempts=3

- <Proxy  balancer://125home>

-     BalancerMember http://10.172.181.110:8080/ loadfactor=3 route=tomcat57

-     BalancerMember http://10.173.3.212:8080/ loadfactor=1 route=tomcat223

- </Proxy>

- <VirtualHost *:80>

-     DocumentRoot "/data/home"

-     ServerName www.125home.cn

-     ServerAlias 125home.cn i.125home.cn

-     ErrorLog "/data/logs/125home.cn-error_log"

-     CustomLog "/data/logs/125home.cn-access_log" common

-     ProxyVia Off

-     ProxyRequests Off

-     ProxyPreserveHost On

- #        ProxyPass / http://125home/ 

-  #       ProxyPassReverse / http://125home/

-         RewriteEngine   On

-         RewriteRule ^/static(.*)        http://ip:8080/static$1 [R=301,P]

-         RewriteRule ^/image(.*)$        http://ip:8080/image$1 [P,L]

-         RewriteRule ^/data/home/(\S+)\.gif$ http://i.125home.cn/$1\.gif [R,L]

-         RewriteRule ^/data/home/(\S+)\.jpg$ http://i.125home.cn/$1\.jpg [R,L]

-         RewriteRule ^/data/home/(\S+)\.jpeg$ http://i.125home.cn/$1\.jpeg [R,L]

-         RewriteRule ^/data/home/(\S+)\.png$ http://i.125home.cn/$1\.png [R,L]

-         <Directory "/data/home">

-                 DirectoryIndex index.html

- #               Options Indexes FollowSymlinks MultiViews

-                 Options Indexes FollowSymLinks Includes ExecCGI

-                 AllowOverride All

-                 Order deny,allow

-                 Require all granted

-                 Allow from all

-         </Directory>

- </VirtualHost>

转载于:https://my.oschina.net/shiyusen/blog/715241

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值