Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/38.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/jsf/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js 如何为同一服务器上的三个应用程序配置我的nginx配置文件_Node.js_Reactjs_Angular_Nginx - Fatal编程技术网

Node.js 如何为同一服务器上的三个应用程序配置我的nginx配置文件

Node.js 如何为同一服务器上的三个应用程序配置我的nginx配置文件,node.js,reactjs,angular,nginx,Node.js,Reactjs,Angular,Nginx,您好,我有三个应用程序(react、angular和node),我想将我的nginx文件配置为: mysite.com用于react,mysite.com/admin用于angular,pmysite.com/api用于node应用程序 #node app location /api/ { proxy_pass http://127.0.0.1:3000; access_log /var/log/nginx/mysite.log;

您好,我有三个应用程序(react、angular和node),我想将我的nginx文件配置为: mysite.com用于react,mysite.com/admin用于angular,pmysite.com/api用于node应用程序

    #node app
    location /api/ {
            proxy_pass http://127.0.0.1:3000;
            access_log /var/log/nginx/mysite.log;
            error_log /var/log/nginx/mysite_error.log;
    }
    #angular app
    location /admin {
    root /var/www/mysite/backoffice/dist/index.html;
                    access_log /var/log/nginx/mysite_bo.log;
            error_log /var/log/nginx/mysite_bo.log;
    }
    location ~ \.(aac|m3u8|ts) {
            root /var/www/mysite/media;
    }
    location  /uploads/ {
           root  /var/www/mysite/;
   }
   #react app
    location / {
            proxy_pass http://127.0.0.1:3006;
            access_log /var/log/nginx/mysite_react.log;
            error_log /var/log/nginx/mysite_react.log;
    }}

/admin not working it redirect to/any solution?

位置/admin
块下的
根路径作为所有后续匹配该模式的请求的基本路径。看起来您已经硬编码了
/admin
路径以提供单个文件
/var/www/mysite/backoffice/dist/index.html

尝试更改它以查看此操作是否有效:

location /admin {
    root /var/www/mysite/backoffice/dist;   # change to this
    access_log /var/log/nginx/mysite_bo.log;
    error_log /var/log/nginx/mysite_bo.log;
}

问题是/管理员重定向到/(反应应用程序)