1

我想根据 oracle http server 12.1.3 上的 http-cookie 更改 WebLogicHost 或位置部分

以下是 mod_wl_ohs.conf 中的原始工作配置

<Location /base>
     SetHandler weblogic-handler
        WebLogicHost x.x.2.16
        WebLogicPort 5051
        DynamicServerList ON
        WLIOTimeoutSecs 3600
    WLSocketTimeoutSecs 750
    ConnectRetrySecs 2
    ConnectTimeoutSecs 10
 </Location>
DynamicServerList ON

对于基于 cookie 的位置更改,我的更改如下所示,(mod_wl_ohs.conf)

RewriteEngine  on
#RewriteCond %{HTTP_COOKIE} LOC_Val=New-Loc [NC]
RewriteRule ^/base/(.*) /newbase/$1 [NC]

<Location /newbase>
     SetHandler weblogic-handler
        WebLogicHost x.x.2.50
        WebLogicPort 7071
        DynamicServerList ON
        WLIOTimeoutSecs 3600
    WLSocketTimeoutSecs 750
    ConnectRetrySecs 2
    ConnectTimeoutSecs 10
</Location>

<Location /base>
     SetHandler weblogic-handler
        WebLogicHost x.x.2.16
        WebLogicPort 5051
        DynamicServerList ON
        WLIOTimeoutSecs 3600
    WLSocketTimeoutSecs 750
    ConnectRetrySecs 2
    ConnectTimeoutSecs 10
 </Location>
DynamicServerList ON

或在位置部分检查 cookie (mod_wl_ohs.conf)

<Location /base>
  <If "%{HTTP_COOKIE} =~ /LOC_Val=New-Loc/">
     SetHandler weblogic-handler
        WebLogicHost x.x.2.50
        WebLogicPort 7071
        DynamicServerList ON
        WLIOTimeoutSecs 3600
    WLSocketTimeoutSecs 750
    ConnectRetrySecs 2
    ConnectTimeoutSecs 10
  </If>
  <Else>
     SetHandler weblogic-handler
        WebLogicHost x.x.2.16
        WebLogicPort 5051
        DynamicServerList ON
        WLIOTimeoutSecs 3600
    WLSocketTimeoutSecs 750
    ConnectRetrySecs 2
    ConnectTimeoutSecs 10
  </Else>
</Location>

在第一个选项中,请求仅转到 2.16。出于测试目的,我尝试评论 RewriteCond 行,仍然 url 请求转到 2.16。

对于第二个选项服务器不启动。怎么了?

如何根据 cookie 值更改 URL,以便将请求转发到 2.50 的位置部分 /newbase

4

0 回答 0