Support multiple domains using a wildcard TLS certificate

Previous to this change, each TLS domain would be written to nginx.conf
using the nginx.ssl.conf template (lines 69-73) but with an empty
"server_name" directive (because NOSSL_SERVER_NAME was not set).

This would then become irrelevant because nginx.conf would get truncated
on line 88, and a single parsing of the template would then be written to
nginx.conf on line 89, meaning only the last TLS domain would be set up to
actually use TLS.

This patch changes this behaviour so that all TLS domains get added to
nginx.conf using the nginx.ssl.conf template (which includes redirecting
HTTP -> HTTPS), and all non-TLS domains get added using the nginx.conf
template, so do not get redirected to a TLS domain.

Signed-off-by: Lewis Marshall <lewis@lmars.net>
This commit is contained in:
Lewis Marshall
2015-02-26 00:48:21 +00:00
parent 6b973a9565
commit a4d79e2de9
2 changed files with 20 additions and 13 deletions

View File

@@ -63,9 +63,11 @@ assert_http_success() {
@test "nginx:build-config (wildcard SSL)" {
setup_test_tls_wildcard
add_domain "wildcard.dokku.me"
add_domain "wildcard1.dokku.me"
add_domain "wildcard2.dokku.me"
deploy_app
assert_ssl_domain "wildcard.dokku.me"
assert_ssl_domain "wildcard1.dokku.me"
assert_ssl_domain "wildcard2.dokku.me"
}
@test "nginx:build-config (with SSL CN mismatch)" {