1、打包好的项目:
首先将打包好的项目放置public下,如下图

2、nginx配置文件
不带注释的伪静态(推荐)
备注:若在 location /admin 中的 admin 后面不加 “斜杠/”,则会出现访问 /admin-user 路由,报 404 错误
location /admin/ {
 try_files $uri $uri/ /index.php?$query_string;
} 
location /api/ {
 try_files $uri $uri/ /index.php?$query_string;
}
location / {
 try_files $uri $uri/ /index.html;
} 
带注释的伪静态
#后台
location /admin {
 try_files $uri $uri/ /index.php?$query_string;
}
#接口
location /api {
 try_files $uri $uri/ /index.php?$query_string;
}
#前台页面
location / {
 try_files $uri $uri/ /index.html;
} 
3、默认文件配置
index.html index.php ndex.htm default.php default.htm default.html
附:phpstudy8.0配置共用域名教程
伪静态设置为如下

高级配置中修改默认为index.html



















![nestjs post请求提交数据量太大会报错 [ExceptionsHandler] request entity too large](https://img-blog.csdnimg.cn/e845c967394544c18144bd8d1f5dd638.png)