在Apache LUA Scipt中设置代理的超时值

时间:2019-05-16 14:17:50

标签: apache proxy lua

我有一个用lua编写的apache反向配置挂钩。当我尝试在此脚本中为keepalive值设置超时值时,对与packend系统的连接没有影响

虚拟服务器:

.
.
.
  <Location /postbox-sdd/>

      LuaHookTranslateName    /etc/httpd/conf.d/hooks.lua map_to_postbox early
      ProxyPassReverse        /postbox-sdd/

      Session On
      SessionEnv On
      SessionCookieName cfsession path=/
      SessionCookieName2 session path=/;domain=localhost;httponly;secure;version=1;
      SessionHeader X-Replace-Session

      # Header edit Set-Cookie ^JSESSIONID=(.*);(.*;);i[Pp]ath=(.+)[^/](;.*)$ JSESSIONID=$1$2;Path=$3/$4

      SetEnv HTTPS on
      RequestHeader edit Destination ^http: https: early

      Header            add     referer "https://172.20.50.28"
      RequestHeader     set     referer "https://172.20.50.28"

      Header            unset CACHE-CONTROL
      RequestHeader     unset CACHE-CONTROL
  </Location>
.
.
.

挂钩:

-- some code for modifying sessionid

  r:ivm_set("connectiontimeout", 10)
  r:ivm_set("timeout", 10)
  r:ivm_set("keepalive", 'on')
  r:ivm_set("enablereuse", 'on')

  r.handler = "proxy-server" -- tell mod_proxy to handle this
  r.proxyreq = apache2.PROXYREQ_REVERSE -- We'll want to do a reverse proxy
  r.filename = "proxy:https://172.20.50.28:443" .. r.uri -- Add the proxy scheme to the destination

  return apache2.OK
end

超时,连接超时和保持活动参数无效。有问题的请求会在300秒后超时,并且页面加载后会话将立即终止。

0 个答案:

没有答案