作为 IIS 子站点的 Express 应用程序无法加载静态文件
Express application as a IIS subsite fails to load static files
我正在 IIS 中使用 Express 设置 Angular 通用应用程序,并使用本文所述的反向代理 https://dev.to/petereysermans/hosting-a-node-js-application-on-windows-with-iis-as-reverse-proxy-397b. If i set my IIS site up as http://example.com with a rewrite url to http://localhost:4000/{R:1}(节点应用程序正在侦听 4000)一切正常。
我想在 IIS 中使用子站点,例如 http://example/abc, so I set up an application under my website called abc which has the abovementioned rewrite rule. Now when I browse to http://example.com/abc the browser is trying to load js/css files from http://example.com,这会导致 404 错误。难道我做错了什么?我之前在 IIS 中将 Angular 个站点设置为子站点(不是 Universal),它可以正确加载 js/css 个文件。
尝试在构建时使用 --deploy-url
选项
ng build --prod --deploy-url /abc
我正在 IIS 中使用 Express 设置 Angular 通用应用程序,并使用本文所述的反向代理 https://dev.to/petereysermans/hosting-a-node-js-application-on-windows-with-iis-as-reverse-proxy-397b. If i set my IIS site up as http://example.com with a rewrite url to http://localhost:4000/{R:1}(节点应用程序正在侦听 4000)一切正常。
我想在 IIS 中使用子站点,例如 http://example/abc, so I set up an application under my website called abc which has the abovementioned rewrite rule. Now when I browse to http://example.com/abc the browser is trying to load js/css files from http://example.com,这会导致 404 错误。难道我做错了什么?我之前在 IIS 中将 Angular 个站点设置为子站点(不是 Universal),它可以正确加载 js/css 个文件。
尝试在构建时使用 --deploy-url
选项
ng build --prod --deploy-url /abc