vuejs应用程序的Nginx子路径被抛出到根路径中

时间:2020-02-17 10:59:55

标签: nginx

我正在使用两个单独的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中错过了什么吗?

0 个答案:

没有答案