improvement(docker): gzip static files (via #5199)
This commit is contained in:
@@ -20,6 +20,8 @@ COPY ./dist/* /usr/share/nginx/html/
|
|||||||
COPY ./docker/run.sh /usr/share/nginx/
|
COPY ./docker/run.sh /usr/share/nginx/
|
||||||
COPY ./docker/configurator /usr/share/nginx/configurator
|
COPY ./docker/configurator /usr/share/nginx/configurator
|
||||||
|
|
||||||
|
RUN find /usr/share/nginx/html/ -type f -regex ".*\.\(html\|js\|css\)" -exec sh -c "gzip < {} > {}.gz" \;
|
||||||
|
|
||||||
RUN chmod +x /usr/share/nginx/run.sh
|
RUN chmod +x /usr/share/nginx/run.sh
|
||||||
|
|
||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
|
|||||||
@@ -12,6 +12,13 @@ http {
|
|||||||
|
|
||||||
keepalive_timeout 65;
|
keepalive_timeout 65;
|
||||||
|
|
||||||
|
gzip on;
|
||||||
|
gzip_static on;
|
||||||
|
gzip_disable "msie6";
|
||||||
|
|
||||||
|
gzip_vary on;
|
||||||
|
gzip_types text/plain text/css application/javascript;
|
||||||
|
|
||||||
map $request_method $access_control_max_age {
|
map $request_method $access_control_max_age {
|
||||||
OPTIONS 1728000; # 20 days
|
OPTIONS 1728000; # 20 days
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user