From 6a20aad67fe001b48fff63dd25642f11df3aa3e7 Mon Sep 17 00:00:00 2001 From: "Il'ya A. Lykov" Date: Wed, 14 May 2014 12:08:29 +0700 Subject: [PATCH] Hide version of the web server --- config/nginx.sample.conf | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/config/nginx.sample.conf b/config/nginx.sample.conf index c59bb331d2b..080fe7db0f8 100644 --- a/config/nginx.sample.conf +++ b/config/nginx.sample.conf @@ -1,6 +1,6 @@ # Additional MIME types that you'd like nginx to handle go in here types { - text/csv csv; + text/csv csv; } upstream discourse { @@ -31,6 +31,7 @@ server { gzip_types application/json text/css application/x-javascript; server_name enter.your.web.hostname.here; + server_tokens off; sendfile on; @@ -75,11 +76,17 @@ server { #if ($invalid_referer) { return 403; } # custom CSS - location ~ /stylesheet-cache/ { try_files $uri =404; } + location ~ /stylesheet-cache/ { + try_files $uri =404; + } # images - location ~* \.(gif|png|jpg|jpeg|bmp|tif|tiff)$ { try_files $uri =404; } + location ~* \.(gif|png|jpg|jpeg|bmp|tif|tiff)$ { + try_files $uri =404; + } # thumbnails & optimized images - location ~ /_optimized/ { try_files $uri =404; } + location ~ /_optimized/ { + try_files $uri =404; + } # attachments must go through the rails application to get the right content-disposition header proxy_set_header Host $http_host;