Merge pull request #2965 from Shopify/dynamic-certificates-nginx

Add Lua module to serve SSL Certificates dynamically
This commit is contained in:
k8s-ci-robot 2018-08-23 20:27:55 -07:00 committed by GitHub
commit b0b575db33
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 577 additions and 1 deletions

View file

@ -85,6 +85,15 @@ http {
else
monitor = res
end
{{ if $all.DynamicCertificatesEnabled }}
ok, res = pcall(require, "certificate")
if not ok then
error("require failed: " .. tostring(res))
else
certificate = res
end
{{ end }}
}
{{ if $all.DynamicConfigurationEnabled }}
@ -775,6 +784,12 @@ stream {
ssl_stapling on;
ssl_stapling_verify on;
{{ end }}
{{ if and (not $all.DisableLua) $all.DynamicCertificatesEnabled}}
ssl_certificate_by_lua_block {
certificate.call()
}
{{ end }}
{{ end }}
{{ if not (empty $server.AuthTLSError) }}