Spaces:
Running
Running
Create nginx.txt
Browse files
nginx.txt
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
server {
|
| 2 |
+
listen 80;
|
| 3 |
+
server_name localhost;
|
| 4 |
+
root /usr/share/nginx/html;
|
| 5 |
+
index index.html;
|
| 6 |
+
|
| 7 |
+
# Gzip Compression
|
| 8 |
+
gzip on;
|
| 9 |
+
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
|
| 10 |
+
gzip_min_length 1000;
|
| 11 |
+
gzip_proxied any;
|
| 12 |
+
|
| 13 |
+
# Caching for Static Assets (Vite builds usually have hashed filenames)
|
| 14 |
+
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
|
| 15 |
+
expires 1y;
|
| 16 |
+
add_header Cache-Control "public, no-transform";
|
| 17 |
+
}
|
| 18 |
+
|
| 19 |
+
# SPA Routing
|
| 20 |
+
location / {
|
| 21 |
+
try_files $uri $uri/ /index.html;
|
| 22 |
+
}
|
| 23 |
+
|
| 24 |
+
# Security Headers
|
| 25 |
+
add_header X-Frame-Options "SAMEORIGIN";
|
| 26 |
+
add_header X-Content-Type-Options "nosniff";
|
| 27 |
+
}
|