fix: added custom nginx configuration to have gzip compression and cache control
Signed-off-by: Louis Vallat <louis@louis-vallat.xyz>
This commit is contained in:
parent
127bbc6c38
commit
21169b9e55
@ -2,5 +2,6 @@ FROM nginx:latest
|
||||
|
||||
EXPOSE 80
|
||||
|
||||
COPY . /usr/share/nginx/html/
|
||||
COPY ./src/ /usr/share/nginx/html/
|
||||
COPY ./nginx.conf /etc/nginx/conf.d/default.conf
|
||||
|
||||
|
24
nginx.conf
Normal file
24
nginx.conf
Normal file
@ -0,0 +1,24 @@
|
||||
server {
|
||||
listen 80;
|
||||
server_name localhost;
|
||||
|
||||
gzip on;
|
||||
gzip_types text/plain application/xml;
|
||||
|
||||
location / {
|
||||
root /usr/share/nginx/html;
|
||||
index index.html index.htm;
|
||||
}
|
||||
|
||||
location ~*.(js|css|ico)$ {
|
||||
root /usr/share/nginx/html;
|
||||
expires 2d;
|
||||
add_header Cache-Control "public, no-transform";
|
||||
}
|
||||
|
||||
location ~*.(ttf|png|jpg|jpeg|gif)$ {
|
||||
root /usr/share/nginx/html;
|
||||
expires 1y;
|
||||
add_header Cache-Control "public, no-transform";
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user