YESWEB项目 生产环境部署


.net core环境下载

下载 ASP.NET Core 3.1 Runtime 

YESWEB项目 生产环境部署

https://download.visualstudio.microsoft.com/download/pr/fa3f472e-f47f-4ef5-8242-d3438dd59b42/9b2d9d4eecb33fe98060fd2a2cb01dcd/dotnet-hosting-3.1.0-win.exe

安装URL重载

IIS URL重写:url-rewrite.exe下载地址

https://www.iis.net/downloads/microsoft/url-rewrite

YESWEB项目 生产环境部署

YESWEB项目 生产环境部署

YESWEB项目 生产环境部署

 

 

部署文件上传至服务器

server和pc复制到服务器上

YESWEB项目 生产环境部署

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配置

应用程序池:

YESWEB项目 生产环境部署

v4.0用于PC

.net core(无托管代码)用于server

 

添加站点:

YESWEB项目 生产环境部署

YESWEB项目 生产环境部署

server站点配置

YESWEB项目 生产环境部署

 

Swagger API文档查看

访问URL:[host]/server/swagger/index.html

注意,到带上 index.html结尾,不然访问不了的

YESWEB项目 生产环境部署

 

 

 

版权声明:本文为YES开发框架网发布内容,转载请附上原文出处连接
张国生
下一篇:没有了
评论列表

发表评论

评论内容
昵称:
关联文章