在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問答/Linux  HTML/ 如何在nginx上的同一域名及端口上配置兩個打包后的react應用?

如何在nginx上的同一域名及端口上配置兩個打包后的react應用?

server {
    listen       80;
    server_name  localhost;

    location /a {
        root   /test/nginx/a;
        index  index.html index.htm;
    try_files $uri /index.html =404;
    }

    location /b {
        root   /test/nginx/b;
        index  index.html index.htm;
    try_files $uri /index.html =404;
    }
}

目前的思路我這樣寫是沒有用的!
請問還有什么寫法嗎?

回答
編輯回答
淚染裳
server {
    listen       80;
    server_name  localhost;

    location /a {
        alias /test/nginx/a;
        index  index.html index.htm;
        try_files $uri /a/index.html;
    }

    location /b {
        alias /test/nginx/b;
        index  index.html index.htm;
        try_files $uri /b/index.html;
    }
}
2017年3月13日 17:36
編輯回答
柚稚
server {
    listen       80;
    server_name  localhost;
    
    root   /test/nginx;

    location /a {
    index  /a/index.html index.htm;
    try_files $uri /index.html =404;
    }

    location /b {
    index  /b/index.html index.htm;
    try_files $uri /index.html =404;
    }
}

這樣呢?

2018年7月19日 06:14