summaryrefslogtreecommitdiff
path: root/frontend/nginx.conf
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/nginx.conf')
-rw-r--r--frontend/nginx.conf27
1 files changed, 27 insertions, 0 deletions
diff --git a/frontend/nginx.conf b/frontend/nginx.conf
new file mode 100644
index 0000000..151afe8
--- /dev/null
+++ b/frontend/nginx.conf
@@ -0,0 +1,27 @@
+# For Docker Compose
+server {
+ listen 80;
+ server_name localhost;
+ root /usr/share/nginx/html;
+ index index.html;
+
+ # Enable gzip compression
+ gzip on;
+ gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
+
+ # SPA routing - send all requests to index.html
+ location / {
+ try_files $uri $uri/ /index.html;
+ }
+
+ # Cache static assets
+ location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
+ expires 1y;
+ add_header Cache-Control "public, immutable";
+ }
+
+ # Security headers
+ add_header X-Frame-Options "SAMEORIGIN" always;
+ add_header X-Content-Type-Options "nosniff" always;
+ add_header X-XSS-Protection "1; mode=block" always;
+} \ No newline at end of file