|
@@ -92,7 +92,9 @@ function scw(r)
|
|
|
end
|
|
|
end
|
|
|
|
|
|
- if has_redis then
|
|
|
+ local captcha_url = os.getenv("SCW_CAPTCHA_URL")
|
|
|
+
|
|
|
+ if has_redis and captcha_url ~= "" then
|
|
|
|
|
|
local v = redis_conn:get("bl:" .. r.useragent_ip)
|
|
|
|
|
@@ -109,7 +111,7 @@ function scw(r)
|
|
|
end
|
|
|
|
|
|
local referer = string.format("%s://%s%s%s", rprotocol, r.hostname, rport, r.unparsed_uri)
|
|
|
- r.headers_out["location"] = string.format("http://docker.scw.systems:8003/?src=%s&r=%s", r.useragent_ip, r:escape(referer))
|
|
|
+ r.headers_out["location"] = string.format(captcha_url, r.useragent_ip, r:escape(referer))
|
|
|
|
|
|
r.headers_in["X-SCW-IP"] = v
|
|
|
r.handler = "proxy-server"
|