From bcd4feeb1eef696e13ef958f6d31f6bdd3b8d9fe Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Thu, 2 Jan 2014 10:11:41 -0800 Subject: [PATCH] nginx/Dockerfile.template: Change default hostname to _ MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit From the docs [1]: In catch-all server examples the strange name “_” can be seen: server { listen 80 default_server; server_name _; return 444; } There is nothing special about this name, it is just one of a myriad of invalid domain names which never intersect with any real name. Still, an invalid domain name makes more sense than 'localhost' for a public server. [1]: http://nginx.org/en/docs/http/server_names.html#miscellaneous_names --- nginx/Dockerfile.template | 1 + 1 file changed, 1 insertion(+) diff --git a/nginx/Dockerfile.template b/nginx/Dockerfile.template index 3cf7124..d2fd42f 100644 --- a/nginx/Dockerfile.template +++ b/nginx/Dockerfile.template @@ -32,6 +32,7 @@ RUN eselect news read new RUN rc-update add nginx default RUN sed -i 's/listen 127.0.0.1;/listen 80 default_server;/' /etc/nginx/nginx.conf +RUN sed -i 's/server_name localhost;/server_name _;/' /etc/nginx/nginx.conf RUN mkdir /var/www/localhost/htdocs # Container networking happens automatically -- 2.26.2