-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnginx-dev-static.conf
More file actions
64 lines (53 loc) · 1.65 KB
/
nginx-dev-static.conf
File metadata and controls
64 lines (53 loc) · 1.65 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
server {
listen 5000;
server_name _;
port_in_redirect off;
absolute_redirect off;
root /usr/share/nginx/html/website;
# Security headers (most are already in HTML, but good to have at server level too)
add_header X-Frame-Options "DENY" always;
add_header X-Content-Type-Options "nosniff" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
# DISABLE ALL caching for development - apply to everything
add_header Cache-Control "no-cache, no-store, must-revalidate" always;
add_header Pragma "no-cache" always;
expires off;
# Gzip compression
gzip on;
gzip_vary on;
gzip_min_length 1024;
gzip_types text/plain text/css text/xml text/javascript application/javascript application/xml+rss application/json;
# Auto-reload timestamp file - served from parent directory (survives website clean)
location = /rebuild-timestamp.txt {
alias /usr/share/nginx/html/rebuild-timestamp.txt;
access_log off;
}
# Main location block
location / {
try_files $uri $uri/ $uri/index.html =404;
}
# Special handling for mathnotes section
location /mathnotes/ {
try_files $uri $uri/ $uri/index.html /mathnotes/$uri/index.html =404;
}
# Error pages
error_page 404 /404/index.html;
location = /404/index.html {
internal;
}
# Sitemap
location = /sitemap.xml {
}
# Robots.txt
location = /robots.txt {
}
# Favicon
location = /favicon.ico {
}
# Disable access to hidden files
location ~ /\. {
deny all;
access_log off;
log_not_found off;
}
}