aboutsummaryrefslogtreecommitdiff
path: root/nginx-common
diff options
context:
space:
mode:
authorMike Crute <mike@crute.us>2019-12-30 22:14:57 +0000
committerMike Crute <mike@crute.us>2019-12-30 22:14:57 +0000
commitd2c86d707d94e4d6a224298add02af42d67d28a3 (patch)
tree24d3ea3bc1d532213e0800cf24534213449e8e25 /nginx-common
parente7a300ded093767e5d60a4cf708d1455bef7b2a9 (diff)
downloaddockerfiles-d2c86d707d94e4d6a224298add02af42d67d28a3.tar.bz2
dockerfiles-d2c86d707d94e4d6a224298add02af42d67d28a3.tar.xz
dockerfiles-d2c86d707d94e4d6a224298add02af42d67d28a3.zip
Update default servers
Diffstat (limited to 'nginx-common')
-rw-r--r--nginx-common/conf/conf.d/default_hosts.conf.tpl13
1 files changed, 6 insertions, 7 deletions
diff --git a/nginx-common/conf/conf.d/default_hosts.conf.tpl b/nginx-common/conf/conf.d/default_hosts.conf.tpl
index 00128a9..d198c98 100644
--- a/nginx-common/conf/conf.d/default_hosts.conf.tpl
+++ b/nginx-common/conf/conf.d/default_hosts.conf.tpl
@@ -18,19 +18,22 @@ map $http_host $can_redirect {
18 18
19server { 19server {
20 listen *:80 default_server; 20 listen *:80 default_server;
21 listen [::]:80 default_server;
21 22
22 location / { 23 location / {
23 if ($can_redirect) { 24 if ($can_redirect) {
24 rewrite (.*) https://$http_host$1 permanent; 25 rewrite (.*) https://$http_host$1 permanent;
25 } 26 }
26 27
27 return 404; 28 default_type text/plain;
29 return 404 "not found";
28 } 30 }
29} 31}
30 32
31{{ if ne (.Get "NGINX_PP_DISABLE_SSL_DEFAULT") "true" }} 33{{ if ne (.Get "NGINX_PP_DISABLE_SSL_DEFAULT") "true" }}
32server { 34server {
33 listen *:443 ssl http2 default_server; 35 listen *:443 ssl http2 default_server;
36 listen [::]:443 ssl http2 default_server;
34 37
35 include includes/hardened_ssl.conf; 38 include includes/hardened_ssl.conf;
36 include includes/hardened_headers.conf; 39 include includes/hardened_headers.conf;
@@ -43,12 +46,8 @@ server {
43 {{ end }} 46 {{ end }}
44 47
45 location / { 48 location / {
46 return 404; 49 default_type text/plain;
47 } 50 return 404 "not found";
48
49 # You may need this to prevent return 404 recursion.
50 location = /404.html {
51 internal;
52 } 51 }
53} 52}
54{{ end }} 53{{ end }}