-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathnginx.conf
More file actions
43 lines (35 loc) · 1.07 KB
/
nginx.conf
File metadata and controls
43 lines (35 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
server {
listen 4173;
server_name localhost;
root /usr/share/nginx/html;
index index.html;
# Backward compatibility redirects from ENSNode services
location = /about {
return 301 /;
}
location = /gql/subgraph-compat {
return 301 /api/subgraph;
}
location = /gql/ponder {
return 301 /;
}
# Try to serve the requested URI, then with .html extension, then as directory, or 404
location / {
try_files $uri $uri.html $uri/ =404;
}
# Custom 404 page
error_page 404 /404.html;
location = /404.html {
internal;
}
# 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 caching for static assets to avoid stale versions
location ~* \.(jpg|jpeg|png|gif|ico|css|js|svg|woff|woff2|ttf|eot)$ {
add_header Cache-Control "no-cache, no-store, must-revalidate";
add_header Pragma "no-cache";
add_header Expires "0";
}
}