我正在使用两个单独的nuxt应用程序,其中一个应放在子路径下,而主要的nuxt应用程序应放在根上
以下是我的nginx配置
server {
listen 443 ssl;
server_name mydomain.com;
client_max_body_size 100m;
root /src/app_ui/dist/;
index index.html index.htm index.php;
location / {
try_files $uri $uri/ /index.html?/$request_uri;
}
location /somepage {
alias /src/other_ui_/dist/;
try_files $uri $uri/ /somepage/index.html?/$request_uri;
}
}
如果我浏览mydomain.com/somepage/news
会很好用,但是如果我更深入mydomain.com/somepage/news/news-of-lorem-ipsum
会出现404错误页面
我在nginx日志中关注了
open() "/src/app_ui/distindex.html" failed (2: No such file or directory),
此错误令人困惑,因为它应使用别名中定义的路径为/ src / other_ui_ / dist /;
我在Nginx conf中错过了什么吗?