代理平衡器和Apache虚拟主机多个域

代理平衡器和Apache虚拟主机多个域,apache,.htaccess,caching,mod-rewrite,proxy,Apache,.htaccess,Caching,Mod Rewrite,Proxy,我们有以下配置,一个apache HTTP服务器将AJP请求代理给另一个应用程序,如下面的代理平衡器配置所示 我们遇到的问题是,应用程序只理解一个主机http头,即exampledomain.com,但我们要求将www.exampledomain.com重写为exampledomain.com,但仍然显示www.exampledomain.com地址 我们在浏览器和Apache服务器之间也有HTTP代理,不希望缓存这些内容 以下是我们的配置: <Proxy balancer://ajp-c

我们有以下配置,一个apache HTTP服务器将AJP请求代理给另一个应用程序,如下面的代理平衡器配置所示

我们遇到的问题是,应用程序只理解一个主机http头,即exampledomain.com,但我们要求将www.exampledomain.com重写为exampledomain.com,但仍然显示www.exampledomain.com地址

我们在浏览器和Apache服务器之间也有HTTP代理,不希望缓存这些内容

以下是我们的配置:

<Proxy balancer://ajp-cluster>
Order deny,allow
Allow from all
BalancerMember ajp://10.10.10.11:8009
</Proxy>

<VirtualHost *:80>
ServerName exampledomain.com
ServerAlias exampledomain.com *.exampledomain.com
   RewriteEngine on
   RewriteCond %{HTTP_HOST} ^www.exampledomain.com
   RewriteRule ^/(.*)$ http://exampledomain.com/$1 [L,R=301,E=nocache:1]
   ## Set the response header if the "nocache" environment variable is set
   ## in the RewriteRule above.
   Header always set Cache-Control "no-store, no-cache, must-revalidate" env=nocache
   ## Set Expires too ...
   Header always set Expires "Thu, 01 Jan 1970 00:00:00 GMT" env=nocache
   ProxyPass / balancer://ajp-cluster/
   ProxyPassReverse / balancer://ajp-cluster/
   </VirtualHost>

命令拒绝,允许
通融
平衡员ajp://10.10.10.11:8009
ServerName exampledomain.com
ServerAlias exampledomain.com*.exampledomain.com
重新启动发动机
重写cond%{HTTP_HOST}^www.exampledomain.com
重写规则^/(.*)$http://exampledomain.com/$1[L,R=301,E=nocache:1]
##如果设置了“nocache”环境变量,则设置响应头
##在上面的规则中。
标头始终设置缓存控制“无存储,无缓存,必须重新验证”env=nocache
##设置也将过期。。。
标题始终设置为过期“Thu,1970年1月1日00:00:00 GMT”env=nocache
ProxyPass/balancer://ajp-cluster/
ProxyPassReverse/balancer://ajp-cluster/