ac1753d643
Deploy Resume / deploy (push) Successful in 6s
- 原先 location / 的 301 重定向拦截了所有请求,导致 /css/ 和 /img/ 无法访问 - 添加独立的 /css/ 和 /img/ location 块,确保静态资源正常加载
45 lines
1.0 KiB
Nginx Configuration File
45 lines
1.0 KiB
Nginx Configuration File
server {
|
|
listen 80;
|
|
server_name localhost;
|
|
root /usr/share/nginx/html;
|
|
index index.html;
|
|
|
|
# 共享静态资源
|
|
location /css/ {
|
|
alias /usr/share/nginx/html/css/;
|
|
}
|
|
|
|
location /img/ {
|
|
alias /usr/share/nginx/html/img/;
|
|
}
|
|
|
|
# 主简历
|
|
location /resume/ {
|
|
alias /usr/share/nginx/html/resume/;
|
|
try_files $uri $uri/ /resume/index.html;
|
|
}
|
|
|
|
# 其他简历导航页
|
|
location /other/ {
|
|
alias /usr/share/nginx/html/other/;
|
|
try_files $uri $uri/ /other/index.html;
|
|
}
|
|
|
|
# 基础架构工程师简历
|
|
location /other/infra-engineer/ {
|
|
alias /usr/share/nginx/html/other/infra-engineer/;
|
|
try_files $uri $uri/ /other/infra-engineer/index.html;
|
|
}
|
|
|
|
# 网络安全工程师简历
|
|
location /other/security-engineer/ {
|
|
alias /usr/share/nginx/html/other/security-engineer/;
|
|
try_files $uri $uri/ /other/security-engineer/index.html;
|
|
}
|
|
|
|
# 根路径重定向到主简历
|
|
location / {
|
|
return 301 /resume/;
|
|
}
|
|
}
|