瀏覽代碼

Merge pull request #82 from Russell-IO/master

Adding server_tokens variable
Jeff Geerling 8 年之前
父節點
當前提交
59cdc01362
共有 3 個文件被更改,包括 7 次插入0 次删除
  1. 4 0
      README.md
  2. 2 0
      defaults/main.yml
  3. 1 0
      templates/nginx.conf.j2

+ 4 - 0
README.md

@@ -77,6 +77,10 @@ TCP connection options. See [this blog post](https://t37.net/nginx-optimization-
 
 Nginx keepalive settings. Timeout should be set higher (10s+) if you have more polling-style traffic (AJAX-powered sites especially), or lower (<10s) if you have a site where most users visit a few pages and don't send any further requests.
 
+    nginx_server_tokens: "on"
+
+Nginx server_tokens settings, this controlls if nginx responds with it's version in the HTTP headers, set to off to disable
+
     nginx_client_max_body_size: "64m"
 
 This value determines the largest file upload possible, as uploads are passed through Nginx before hitting a backend like `php-fpm`. If you get an error like `client intended to send too large body`, it means this value is set too low.

+ 2 - 0
defaults/main.yml

@@ -26,6 +26,8 @@ nginx_tcp_nodelay: "on"
 nginx_keepalive_timeout: "65"
 nginx_keepalive_requests: "100"
 
+nginx_server_tokens: "on"
+
 nginx_client_max_body_size: "64m"
 
 nginx_server_names_hash_bucket_size: "64"

+ 1 - 0
templates/nginx.conf.j2

@@ -35,6 +35,7 @@ http {
     keepalive_timeout  {{ nginx_keepalive_timeout }};
     keepalive_requests {{ nginx_keepalive_requests }};
 
+    server_tokens {{ nginx_server_tokens }};
     #gzip  on;
 
 {% if nginx_proxy_cache_path %}