include non ssl server names in SSL server block. fixes #2086

This commit is contained in:
Michael Hobbs
2016-04-08 13:21:26 -07:00
parent 95993955c5
commit db94fcb6b4
2 changed files with 10 additions and 0 deletions

View File

@@ -2,6 +2,7 @@ server {
listen [::]:{{ .NGINX_SSL_PORT }} ssl spdy;
listen {{ .NGINX_SSL_PORT }} ssl spdy;
{{ if .SSL_SERVER_NAME }}server_name {{ .SSL_SERVER_NAME }}; {{ end }}
{{ if .NOSSL_SERVER_NAME }}server_name {{ .NOSSL_SERVER_NAME }}; {{ end }}
{{ include "log.config" . }}
ssl_certificate {{ .APP_SSL_PATH }}/server.crt;
ssl_certificate_key {{ .APP_SSL_PATH }}/server.key;

View File

@@ -41,6 +41,15 @@ assert_error_log() {
assert_error_log ${TEST_APP}
}
@test "(nginx-vhosts) nginx:build-config (with SSL & unrelated domain)" {
setup_test_tls
add_domain "node-js-app.dokku.me"
add_domain "test.dokku.me"
deploy_app
assert_ssl_domain "node-js-app.dokku.me"
assert_http_redirect "http://test.dokku.me" "https://test.dokku.me:443/"
}
@test "(nginx-vhosts) nginx:build-config (wildcard SSL)" {
setup_test_tls wildcard
add_domain "wildcard1.dokku.me"