Skip to content

Commit

Permalink
fix duplicate hsts bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ElvinEfendi committed Dec 12, 2019
1 parent 49ba53b commit 54918c0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions rootfs/etc/nginx/lua/lua_ingress.lua
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,9 @@ function _M.rewrite(location_config)

ngx_redirect(uri, config.http_redirect_code)
end
end

function _M.header()
if config.hsts and ngx.var.scheme == "https" and certificate_configured_for_current_request then
local value = "max-age=" .. config.hsts_max_age
if config.hsts_include_subdomains then
Expand Down
1 change: 1 addition & 0 deletions rootfs/etc/nginx/template/nginx.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -991,6 +991,7 @@ stream {
#}

header_filter_by_lua_block {
lua_ingress.header()
plugins.run()
}

Expand Down

0 comments on commit 54918c0

Please sign in to comment.