【Azure 应用服务】App Service For Windows 中如何设置代理实现前端静态文件和后端Java Spring Boot Jar包 - LuBu0505/My-Code GitHub Wiki
部署在App Service For Windows 中的网站使用 Java Spring Boot + 静态文件 (浏览器端使用Vue.js 与服务器端Java Spring Boot交互),如何来实现呢?
1:在App Service的门户中,通过Configration 的 Path Mappings来实现,如图:
2:然后将静态文件内容上传至 d:\home\site\staticpage下
3:在目录d:\home\site\staticpage中添加 web.config,指定该虚拟应用为static content,文件内容如下:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="StaticHandler" verb="*" path="*" type="System.Web.StaticFileHandler" preCondition="integratedMode" />
</handlers>
</system.webServer>
</configuration>
1)将App Service runtime stack配置为Java -> Java SE (Embedded Web Server)
2)将主站点的Jar文件重命名为app.jar并上传至d:\home\site\wwwroot下(注:此处不需要web.config,这与通常在Windows部署Java应用有区别)
当在复杂的环境中面临问题,格物之道需:浊而静之徐清,安以动之徐生。 云中,恰是如此!
分类: 【Azure 应用服务】
标签: App Service, Java Spring Boot + 静态文件