Fixed nginx conf issue

This commit is contained in:
2024-08-07 21:34:03 -04:00
parent 58964b60dc
commit f44284685f
5 changed files with 20 additions and 23 deletions
+6 -6
View File
@@ -25,21 +25,21 @@ server {
local scheme = ngx.var.scheme
if scheme == "http" then
if ngx.req.targetInfo["forcessl"] == "true" then
if ngx.ctx.targetInfo["forcessl"] == "true" then
return ngx.redirect("https://"..host..uri, 301)
end
end
if ngx.req.targetInfo["targetssl"] == "true" then
if ngx.ctx.targetInfo["targetssl"] == "true" then
ngx.var.target_scheme = "https"
end
if ngx.req.targetInfo["host-pass-though"] == "false" then
ngx.var.header_host = ngx.req.targetInfo["ip"]
if ngx.ctx.targetInfo["host-pass-though"] == "false" then
ngx.var.header_host = ngx.ctx.targetInfo["ip"]
end
ngx.var.target = ngx.req.targetInfo["ip"]
ngx.var.target_port = ngx.req.targetInfo["targetPort"]
ngx.var.target = ngx.ctx.targetInfo["ip"]
ngx.var.target_port = ngx.ctx.targetInfo["targetPort"]
';