Skip to content

Commit 84be251

Browse files
committed
added nginx.conf to frontend
1 parent 79a13d9 commit 84be251

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed

littleX_FE/dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#TODO: need to include a dockerfile for littleXFE

littleX_FE/nginx.conf

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
events {
2+
worker_connections 1024;
3+
}
4+
5+
http {
6+
include /etc/nginx/mime.types;
7+
default_type application/octet-stream;
8+
9+
# Enable gzip compression
10+
gzip on;
11+
gzip_vary on;
12+
gzip_min_length 1024;
13+
gzip_types
14+
text/plain
15+
text/css
16+
text/xml
17+
text/javascript
18+
application/javascript
19+
application/xml+rss
20+
application/json;
21+
22+
server {
23+
listen 80;
24+
server_name localhost;
25+
26+
root /usr/share/nginx/html;
27+
index index.html;
28+
29+
# Handle client-side routing
30+
location / {
31+
try_files $uri $uri/ /index.html;
32+
}
33+
34+
# Cache static assets
35+
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
36+
expires 1y;
37+
add_header Cache-Control "public, immutable";
38+
}
39+
40+
# Security headers
41+
add_header X-Frame-Options "SAMEORIGIN" always;
42+
add_header X-XSS-Protection "1; mode=block" always;
43+
add_header X-Content-Type-Options "nosniff" always;
44+
add_header Referrer-Policy "no-referrer-when-downgrade" always;
45+
add_header Content-Security-Policy "default-src 'self' http: https: data: blob: 'unsafe-inline'" always;
46+
}
47+
}

0 commit comments

Comments
 (0)