From: W. Trevor King Date: Thu, 2 Jan 2014 18:11:41 +0000 (-0800) Subject: nginx/Dockerfile.template: Change default hostname to _ X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=bcd4feeb1eef696e13ef958f6d31f6bdd3b8d9fe;p=dockerfile.git nginx/Dockerfile.template: Change default hostname to _ 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 --- 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