问题:
- 正常访问200 OK
- 刷新 404
解决:
server {
listen 80;
server_name localhost;
location / {
root /mydata/nginx/html;
index index.html;
try_files $uri $uri/ /index.html;
}
}
说明1: root 静态资源访问路径
说明2: index 默认页面
说明3: try_files… 解决刷新404