Skip to content

Instantly share code, notes, and snippets.

@dolegi dolegi/Dockerfile
Last active Jun 12, 2019

Embed
What would you like to do?
dockerized nginx static file server with subdomain dynamic routing and gzip compression
server {
server_name ~^(?<subdomain>.+).dlg.com$ ;
root /usr/share/nginx/$subdomain;
listen 7070 http2;
gzip on;
gzip_disable "msie6";
gzip_min_length 0;
gzip_types *;
location / {
index index.html index.htm;
expires 7d;
}
}
FROM nginx:alpine
COPY default.conf /etc/nginx/conf.d/default.conf
RUN mkdir -p /usr/share/nginx/one
RUN mkdir -p /usr/share/nginx/two
COPY index.html /usr/share/nginx/one/index.html
COPY index2.html /usr/share/nginx/two/index.html
127.0.0.1 one.dlg.com
127.0.0.1 two.dlg.com
<h1>one</h1>
<h1>two</h1>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.