From 2a51301a5db074edc9060a99b07b56faa48d8714 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Thu, 1 Jan 2015 15:03:43 -0500 Subject: [PATCH] Disable server tokens in nginx. Closes #857 --- plugins/nginx-vhosts/templates/nginx.conf | 1 + plugins/nginx-vhosts/templates/nginx.ssl.conf | 2 ++ 2 files changed, 3 insertions(+) diff --git a/plugins/nginx-vhosts/templates/nginx.conf b/plugins/nginx-vhosts/templates/nginx.conf index 8ed426275..06b12ac56 100644 --- a/plugins/nginx-vhosts/templates/nginx.conf +++ b/plugins/nginx-vhosts/templates/nginx.conf @@ -2,6 +2,7 @@ server { listen [::]:80; listen 80; server_name $NOSSL_SERVER_NAME; + server_tokens off; location / { proxy_pass http://$APP; proxy_http_version 1.1; diff --git a/plugins/nginx-vhosts/templates/nginx.ssl.conf b/plugins/nginx-vhosts/templates/nginx.ssl.conf index 5cde7484a..53164b353 100644 --- a/plugins/nginx-vhosts/templates/nginx.ssl.conf +++ b/plugins/nginx-vhosts/templates/nginx.ssl.conf @@ -2,6 +2,7 @@ server { listen [::]:80; listen 80; server_name $NOSSL_SERVER_NAME; + server_tokens off; return 301 https://$SSL_SERVER_NAME\$request_uri; } @@ -9,6 +10,7 @@ server { listen [::]:443 ssl spdy; listen 443 ssl spdy; server_name $SSL_SERVER_NAME; + server_tokens off; $SSL_DIRECTIVES keepalive_timeout 70;