NGINX: Remove inline Lua from template. (#11806)
This commit is contained in:
parent
ee61440780
commit
6510535ae0
30 changed files with 361 additions and 233 deletions
|
|
@ -1,4 +1,5 @@
|
|||
local ngx_re_split = require("ngx.re").split
|
||||
local string_to_bool = require("util").string_to_bool
|
||||
|
||||
local certificate_configured_for_current_request =
|
||||
require("certificate").configured_for_current_request
|
||||
|
|
@ -108,7 +109,16 @@ end
|
|||
-- rewrite gets called in every location context.
|
||||
-- This is where we do variable assignments to be used in subsequent
|
||||
-- phases or redirection
|
||||
function _M.rewrite(location_config)
|
||||
function _M.rewrite()
|
||||
|
||||
local location_config = {
|
||||
force_ssl_redirect = string_to_bool(ngx.var.force_ssl_redirect),
|
||||
ssl_redirect = string_to_bool(ngx.var.ssl_redirect),
|
||||
force_no_ssl_redirect = string_to_bool(ngx.var.force_no_ssl_redirect),
|
||||
preserve_trailing_slash = string_to_bool(ngx.var.preserve_trailing_slash),
|
||||
use_port_in_redirects = string_to_bool(ngx.var.use_port_in_redirects),
|
||||
}
|
||||
|
||||
ngx.var.pass_access_scheme = ngx.var.scheme
|
||||
|
||||
ngx.var.best_http_host = ngx.var.http_host or ngx.var.host
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue