我在Docker容器中有一个AngularDart站点,前面有一个Nginx路由,如: http://<ip>/site . 我可以附加到容器并启动 webdev serve .

但是当我 curl http://<ip>/site
我明白了:

Could not find web/site/index.html or any files in web/site

在我尝试解决这个问题时,我正在查看以下描述:

this路由描述中:

<script>
  // WARNING: DO NOT set the <base href> like this in production!
  // Details: https://webdev.dartlang.org/angular/guide/router
  (function () {
    var m = document.location.pathname.match(/^(\/[-\w]+)+\/web($|\/)/);
    document.write('<base href="' + (m ? m[0] : '/') + '" />');
  }());
</script>

更新:如果我修复集:

document.write('<base href="/site/"/>');

它适用于浏览器中的错误,无法找到main.js - 但它仍然有效 .

你知道如何修复路由问题og可能只是 /web($|\/)/ 在做什么?