Merge pull request #1476 from progrium/1123_mh-nginx-novhost

nginx proxy without VHOST
This commit is contained in:
Jose Diaz-Gonzalez
2015-09-19 17:54:26 -04:00
30 changed files with 459 additions and 284 deletions

View File

@@ -142,16 +142,6 @@ check_urls() {
check_urls http://www.test.app.dokku.me
}
@test "(core) dockerfile port exposure" {
deploy_app dockerfile
run bash -c "grep -A1 upstream $DOKKU_ROOT/$TEST_APP/nginx.conf | grep -q 3000"
echo "output: "$output
echo "status: "$status
assert_success
check_urls http://${TEST_APP}.dokku.me
}
@test "(core) port exposure (xip.io style hostnames)" {
echo "127.0.0.1.xip.io" > "$DOKKU_ROOT/VHOST"
deploy_app
@@ -164,6 +154,16 @@ check_urls() {
check_urls http://my-cool-guy-test-app.127.0.0.1.xip.io
}
@test "(core) dockerfile port exposure" {
deploy_app dockerfile
run bash -c "grep -A1 upstream $DOKKU_ROOT/$TEST_APP/nginx.conf | grep -q 3000"
echo "output: "$output
echo "status: "$status
assert_success
check_urls http://${TEST_APP}.dokku.me
}
@test "(core) port exposure (dockerfile raw port)" {
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
cat<<EOF > $DOCKERFILE

View File

@@ -18,7 +18,7 @@ teardown() {
assert_ssl_domain() {
local domain=$1
assert_app_domain "${domain}"
assert_http_redirect "http://${domain}" "https://${domain}/"
assert_http_redirect "http://${domain}" "https://${domain}:443/"
assert_http_success "https://${domain}"
}

View File

@@ -175,20 +175,20 @@ custom_ssl_nginx_template() {
[[ -z "$APP" ]] && APP="$TEST_APP"
cat<<EOF > $DOKKU_ROOT/$APP/nginx.conf.template
server {
listen [::]:80;
listen 80;
listen [::]:\$NGINX_PORT;
listen \$NGINX_PORT;
server_name \$NOSSL_SERVER_NAME;
return 301 https://\$SSL_SERVER_NAME\\\$request_uri;
return 301 https://\\\$host:\$NGINX_SSL_PORT\\\$request_uri;
}
server {
listen [::]:443 ssl spdy;
listen 443 ssl spdy;
listen [::]:\$NGINX_SSL_PORT ssl spdy;
listen \$NGINX_SSL_PORT ssl spdy;
server_name \$SSL_SERVER_NAME;
\$SSL_DIRECTIVES
keepalive_timeout 70;
add_header Alternate-Protocol 443:npn-spdy/2;
add_header Alternate-Protocol \$NGINX_SSL_PORT:npn-spdy/2;
location / {
proxy_pass http://\$APP;
proxy_http_version 1.1;
@@ -210,8 +210,8 @@ custom_nginx_template() {
[[ -z "$APP" ]] && APP="$TEST_APP"
cat<<EOF > $DOKKU_ROOT/$APP/nginx.conf.template
server {
listen [::]:80;
listen 80;
listen [::]:\$NGINX_PORT;
listen \$NGINX_PORT;
server_name \$NOSSL_SERVER_NAME;
location / {