-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnginx.conf
More file actions
23 lines (20 loc) · 831 Bytes
/
Copy pathnginx.conf
File metadata and controls
23 lines (20 loc) · 831 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
server {
listen 80;
server_name _;
root /usr/share/nginx/html;
index index.html;
# Serve static assets with long cache
location /assets/ {
expires 1y;
add_header Cache-Control "public, immutable";
}
# Client-side routing — send all requests to index.html
location / {
try_files $uri $uri/ /index.html;
}
# Security headers
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-Content-Type-Options "nosniff" always;
add_header Referrer-Policy "no-referrer" always;
add_header Content-Security-Policy "default-src 'self'; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; font-src 'self' https://fonts.gstatic.com; script-src 'self'; connect-src 'none'; img-src 'self' data:; object-src 'none'; frame-src 'none'" always;
}