diff --git a/plugins/nginx-vhosts/install b/plugins/nginx-vhosts/install index 9e30c5359..a2dfc49d6 100755 --- a/plugins/nginx-vhosts/install +++ b/plugins/nginx-vhosts/install @@ -44,6 +44,7 @@ events { } http { + server_tokens off; sendfile on; tcp_nopush on; tcp_nodelay on; diff --git a/tests/unit/nginx-vhosts.bats b/tests/unit/nginx-vhosts.bats index 8eda6458c..db00a7ce5 100644 --- a/tests/unit/nginx-vhosts.bats +++ b/tests/unit/nginx-vhosts.bats @@ -4,15 +4,23 @@ load test_helper setup() { create_app - setup_test_tls - deploy_app } teardown() { destroy_app } +@test "nginx (no server tokens)" { + deploy_app + run /bin/bash -c "curl -s -D - $(dokku url $TEST_APP) -o /dev/null | egrep '^Server' | egrep '[0-9]+'" + echo "output: "$output + echo "status: "$status + assert_failure +} + @test "nginx:build-config (with SSL CN mismatch)" { + setup_test_tls + deploy_app run /bin/bash -c "dokku domains $TEST_APP | grep node-js-app.dokku.me" echo "output: "$output echo "status: "$status