YESWEB项目 生产环境部署
.net core环境下载
下载 ASP.NET Core 3.1 Runtime
安装URL重载
IIS URL重写:url-rewrite.exe下载地址
https://www.iis.net/downloads/microsoft/url-rewrite
部署文件上传至服务器
server和pc复制到服务器上
pc文件夹中要有web.config配置文件,用于路由url重载
XML 全选
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="yesweb-server" enabled="true" stopProcessing="true">
<match url="server/[^/]+\/" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
</conditions>
<action type="None" />
</rule>
<rule name="yesweb-subapp" enabled="true" stopProcessing="true">
<match url="subapp/[^/]+\/" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
</conditions>
<action type="Rewrite" url="/{R:0}index.html" />
</rule>
<rule name="main" enabled="true" stopProcessing="false">
<match url=".*" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
</conditions>
<action type="Rewrite" url="/index.html" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
修改 Server/appsettings.json
Environment 修改为:production
不然,微应用无法正确加载
IIS配置
应用程序池:
v4.0用于PC
.net core(无托管代码)用于server
添加站点:
server站点配置
Swagger API文档查看
访问URL:[host]/server/swagger/index.html
注意,到带上 index.html
结尾,不然访问不了的
版权声明:本文为YES开发框架网发布内容,转载请附上原文出处连接
YESWEB 张国生