angular - 使用 nginx 作为反向代理在 Azure Service Fabric 中部署 Angular8 应用程序
问题描述
我有一个部署在 Azure 服务结构中并且工作正常的 Angular 应用程序。我在 nginx 中提供了路径,它能够重定向到正确的路径。现在我计划根据语言创建单独的文件夹。所以以前,我的 wwwroot 文件夹中只有一个 index.html 文件和 5 个包。但是现在在我的 wwwroot 文件夹中,我有每种语言的文件夹,并且在各自的文件夹中都有这六个文件。
上一个 nginx 路径
location ~* /StudentAdministration {
http://127.0.0.1:19081/StudentAdministration/StudentAdministrationClient;
在我的改变之后
map $http_accept_language $lang {
default en;
~en en;
~es es;
~fr fr;
}
location ~* /StudentAdministration(.*) {
http://127.0.0.1:19081/StudentAdministration/StudentAdministrationClient/$lang$1;
}
我能够使用 map 函数正确获取 lang 值。
当我尝试点击 url/StudentAdministration 时,它会抛出错误。
开发模式 切换到开发环境会显示有关所发生错误的详细信息。
我的计划是点击 url/StudentAdministration 以便它进入 wwwroot 中的 en 文件夹并获取 index.html,然后在其中加载捆绑包。但它不起作用。
解决方案
推荐阅读
- mysql - 从 n:n 关系中选择一个值
- python - SHAP 解释器识别错误的框架
- python - Python 仅使用请求从 API 调用中获取单词
- automation - 当我在 findElement 方法上使用 appium 时,我有元素实例,但元素没有获得焦点
- django - 在 HTML 中创建动态数量的表单字段并从请求中提取它们(Django)
- javascript - 如何在快递中捕获 4xx 和 5xx 错误?
- python - 跨 QTabWidgets 传递信息/变量的正确方法?
- flutter - 如何在 Flutter 中自定义 Arrow Back 的高度和宽度
- javascript - 通过删除关键字删除即时搜索内容
- python - Django显示所有对象和foreach对象所有兼容对象