Add frontend Dockerfile and nginx config
Browse files- frontend/nginx.conf +36 -0
frontend/nginx.conf
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
server {
|
| 2 |
+
listen 80;
|
| 3 |
+
server_name _;
|
| 4 |
+
root /usr/share/nginx/html;
|
| 5 |
+
index index.html;
|
| 6 |
+
|
| 7 |
+
# Gzip compression
|
| 8 |
+
gzip on;
|
| 9 |
+
gzip_vary on;
|
| 10 |
+
gzip_min_length 1024;
|
| 11 |
+
gzip_types text/plain text/css application/json application/javascript text/xml application/xml text/javascript;
|
| 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 |
+
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
|
| 18 |
+
|
| 19 |
+
# Cache static assets
|
| 20 |
+
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
|
| 21 |
+
expires 1y;
|
| 22 |
+
add_header Cache-Control "public, immutable";
|
| 23 |
+
}
|
| 24 |
+
|
| 25 |
+
# SPA routing - serve index.html for all routes
|
| 26 |
+
location / {
|
| 27 |
+
try_files $uri $uri/ /index.html;
|
| 28 |
+
}
|
| 29 |
+
|
| 30 |
+
# Health check endpoint
|
| 31 |
+
location /nginx-health {
|
| 32 |
+
access_log off;
|
| 33 |
+
return 200 "healthy\n";
|
| 34 |
+
add_header Content-Type text/plain;
|
| 35 |
+
}
|
| 36 |
+
}
|