|
@@ -3,10 +3,11 @@ server {
|
|
|
listen 80; # 监听端口
|
|
listen 80; # 监听端口
|
|
|
server_name localhost; # 域名或 IP
|
|
server_name localhost; # 域名或 IP
|
|
|
|
|
|
|
|
|
|
+ user root;
|
|
|
|
|
+
|
|
|
# 前端静态文件
|
|
# 前端静态文件
|
|
|
location / {
|
|
location / {
|
|
|
- autoindex on;
|
|
|
|
|
- alias /usr/share/nginx/html; # Vue/React 打包后的 dist 目录
|
|
|
|
|
|
|
+ root /usr/share/nginx/html; # Vue/React 打包后的 dist 目录
|
|
|
index index.html;
|
|
index index.html;
|
|
|
try_files $uri $uri/ /index.html; # 支持 Vue/React 前端路由
|
|
try_files $uri $uri/ /index.html; # 支持 Vue/React 前端路由
|
|
|
}
|
|
}
|