【发布时间】:2016-11-24 08:48:32
【问题描述】:
我想在同一个 Azure WebApp 上部署两个不同的应用程序,如下所示:
webapp.azurewebsites.net/api/ <-- run the Java REST API here
webapp.azurewebsites.net/site/ <- put the Angular2 app here
问题
这两个应用程序都部署在服务器上,但目前我只能使用web.config 运行 REST API,如下所示:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Force HTTPS" enabled="true">
<match url="(.*)" ignoreCase="false"/>
<conditions>
<add input="{HTTPS}" pattern="off"/>
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}/{R:1}" appendQueryString="true" redirectType="Permanent"/>
</rule>
</rules>
</rewrite>
<handlers>
<add name="httpPlatformHandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified"/>
</handlers>
<httpPlatform processPath="%JAVA_HOME%\bin\java.exe"
arguments="-jar D:\home\site\wwwroot\webapps\rest-api.war">
</httpPlatform>
</system.webServer>
</configuration>
但我无法访问服务器上的 Angular2 应用程序,也找不到如何同时配置 Java 应用程序和 Angular2 应用程序的文档。
我还尝试使用 Application settings 下 Azure 仪表板中的 Virtual applications and directories 设置来实现这一点 - 但它不起作用,我找不到关于如何实现这一点的体面文档,或者如果这是甚至可以设置Virtual applications and directories。
我试图移动 Angular2 站点,但无法配置服务器以便在 Java 应用程序运行时可以访问 Angular2 应用程序。
问题
有人能给我指出一个关于如何实现这一点的好文档,或者详细描述部署过程(关于配置,例如 Azure 仪表板中的 Application settings 和 web.config 文件)?
【问题讨论】:
标签: azure web-config azure-web-app-service