多个应用程序/位置的历史状态NGINX设置

多个应用程序/位置的历史状态NGINX设置,nginx,url-routing,pushstate,html5-history,Nginx,Url Routing,Pushstate,Html5 History,此时,对于一个子域,我可以部署一个uglifiedreact router reduxbasic示例,并让它与历史API(pushState)一起工作 你可以在 我想将该子域用于多个SPA。因此,我尝试添加其他位置(目前使用类似的应用程序) 所以我创建了一个/home/iot/public_html/xtest/basic,并在那里放了一个类似的应用程序。它找到正确的index.html,但只显示标题 react路由器redux基本示例 在xtest/basic中 如果有多个应用程序在一个N

此时,对于一个子域,我可以部署一个uglified
react router redux
basic示例,并让它与历史API(pushState)一起工作

你可以在

我想将该子域用于多个SPA。因此,我尝试添加其他位置(目前使用类似的应用程序)

所以我创建了一个/home/iot/public_html/xtest/basic,并在那里放了一个类似的应用程序。它找到正确的index.html,但只显示标题


react路由器redux基本示例
在xtest/basic中
如果有多个应用程序在一个NGINX子域上运行pushstate路由,我将如何应对

(我曾尝试使用“如何设置NGINX以根据位置(在同一服务器名称下)和子例程部署不同的单页应用程序(SPA…即静态文件)”的想法,但没有成功)

server {
    listen 80;
    root /home/iot/public_html/xtest;
    server_name iot.sitebuilt.net;
    index index.php index.html index.htm;
    location / {
        try_files $uri $uri/ /index.html;
    }
}
server {
    listen 80;
    root /home/iot/public_html/xtest;
    server_name iot.sitebuilt.net;
    index index.php index.html index.htm;
    location / {
        try_files $uri $uri/ /index.html;
    }
    location ^~ /basic {
        try_files $uri $uri/ /basic/index.html;
    }
}
<!DOCTYPE html>
<html>
  <head>
    <title>react-router-redux basic example</title>
    <meta charset="utf8"/>
  </head>
  <body>
    <h4>in xtest/basic</h4>
    <div id="mount"></div>
    <script src="./vendors.js"></script>
    <script src="./app.js"></script>
  </body>
</html>