File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
k8s/drexel-scraper/templates Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -7,9 +7,11 @@ metadata:
7
7
cert-manager.io/cluster-issuer : letsencrypt-prod
8
8
nginx.ingress.kubernetes.io/server-snippet : |
9
9
access_by_lua_block {
10
- if ngx.var.uri == "/" then
10
+ local uri = ngx.var.uri
11
+ -- Check if the URI is "/" or starts with "/d/"
12
+ if uri == "/" or ngx.re.find(uri, "^/d/") then
11
13
local orig_args = ngx.var.args or ""
12
- -- Use ngx.re.find to match using a PCRE pattern .
14
+ -- Use PCRE to check if "kiosk" exists anywhere in the query string .
13
15
local res, err = ngx.re.find(orig_args, "(^|&)kiosk($|&)")
14
16
if not res then
15
17
local new_query
@@ -18,7 +20,7 @@ metadata:
18
20
else
19
21
new_query = orig_args .. "&kiosk"
20
22
end
21
- return ngx.redirect(ngx.var.scheme .. "://" .. ngx.var.host .. "/ ?" .. new_query, 302)
23
+ return ngx.redirect(ngx.var.scheme .. "://" .. ngx.var.host .. uri .. " ?" .. new_query, 302)
22
24
end
23
25
end
24
26
}
You can’t perform that action at this time.
0 commit comments