1,找到Nginx的配置文件Nginx.conf
配置如下即可解决
location / {
root html; #路径
index index.html index.htm;
try_files $uri $uri/ /index.html;
}
Nginx.conf全部配置文件
worker_processes 1;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
server_name localhost;
location / {
root html; #路径
index index.html index.htm;
try_files $uri $uri/ /index.html;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
}