Files
resume/nginx.conf
T
wonder a7ea024737
Deploy Resume / deploy (push) Successful in 2m23s
修复切换版本跳转被浏览器缓存的旧 301 劫持
旧站点 / → 301 /resume/ 曾被浏览器缓存,普通窗口点击切换入口命中缓存
跳转链(无痕正常)。导航入口改用无缓存历史的 /index.html,
并为 HTML 响应加 Cache-Control: no-cache 防止复发
2026-11-03 13:49:31 +08:00

70 lines
1.7 KiB
Nginx Configuration File

server {
listen 80;
server_name localhost;
absolute_redirect off;
root /usr/share/nginx/html;
index index.html;
# HTML 不缓存(旧站点 301 曾被浏览器缓存导致跳转异常;同时保证面试官看到最新简历)
add_header Cache-Control "no-cache";
# 共享静态资源
location /css/ {
alias /usr/share/nginx/html/css/;
}
location /img/ {
alias /usr/share/nginx/html/img/;
}
# 纯文本简历(便于复制粘贴到招聘系统)
location ~ ^/txt/(private|soe)/(dev|support)$ {
default_type "text/plain; charset=utf-8";
alias /usr/share/nginx/html/txt/$1/$2/index.txt;
}
# 纯文本选择页
location = /txt {
default_type "text/html; charset=utf-8";
alias /usr/share/nginx/html/txt/index.html;
}
location = /txt/ {
return 301 /txt;
}
# ---- 旧地址兼容(301 到新地址,面试官旧链接不失效) ----
location = /resume {
return 301 /private/dev/;
}
location ^~ /resume/ {
return 301 /private/dev/;
}
location = /soe {
return 301 /soe/dev/;
}
location = /soe/ {
return 301 /soe/dev/;
}
location = /soe/index.html {
return 301 /soe/dev/;
}
location = /txt/resume {
return 301 /txt/private/dev;
}
location = /txt/soe {
return 301 /txt/soe/dev;
}
location = /other {
return 301 /;
}
location ^~ /other/ {
return 301 /;
}
# 根路由 = 导航页;四份简历:/private/dev/ /private/support/ /soe/dev/ /soe/support/
location / {
try_files $uri $uri/ =404;
}
}