1、正常访问OK
2、F5刷新404
server { listen 80; root /opt/dist; server_name i.hgsuper.cn; index index.html; location / { root /opt/dist; index index.html; try_files $uri $uri/ /index.html; } } 说明1: root 源代码路径 说明2: index 默认页面 说明3: try_files.... 解决刷新404
server { listen 80; root /opt/dist; server_name i.hgsuper.cn; index index.html; location / { root /opt/dist; index index.html; try_files $uri $uri/ /index.html; } }
说明1: root 源代码路径
说明2: index 默认页面
说明3: try_files.... 解决刷新404