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 |