File tree Expand file tree Collapse file tree 2 files changed +31
-0
lines changed
Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Original file line number Diff line number Diff line change 11FROM nginx:alpine
22
3+ COPY nginx.conf /etc/nginx/conf.d/default.conf
34COPY dist /usr/share/nginx/html
Original file line number Diff line number Diff line change 1+ server {
2+ listen 80 ;
3+ server_name _;
4+ root /usr/share/nginx/html;
5+ index index .html;
6+
7+ # Enable gzip compression
8+ gzip on;
9+ gzip_vary on;
10+ gzip_min_length 1024 ;
11+ gzip_types text/plain text/css text/xml text/javascript application/javascript application/xml+rss application/json;
12+
13+ # Security headers
14+ add_header X-Frame-Options "SAMEORIGIN" always;
15+ add_header X-Content-Type-Options "nosniff" always;
16+ add_header X-XSS-Protection "1; mode=block" always;
17+
18+ # Custom 404 page
19+ error_page 404 /404 .html;
20+
21+ location / {
22+ try_files $uri $uri / $uri .html =404 ;
23+ }
24+
25+ # Cache static assets
26+ location ~ * \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
27+ expires 1y ;
28+ add_header Cache-Control "public, immutable" ;
29+ }
30+ }
You can’t perform that action at this time.
0 commit comments