美文网首页
IIS 安装部署.net + vue

IIS 安装部署.net + vue

作者: Messix_1102 | 来源:发表于2023-11-23 08:40 被阅读0次

IIS 部署.net core

  1. 安装对应版本的 dotnet-hosting-6.0.0-win
  2. 创建网站,设置应用程序池为 非托管

IIS 部署vue

  1. 安装 requestRouter_amd64
  2. 安装 rewrite_amd64_zh-CN
  3. 创建网站
  4. 网站根目录添加 web.config 文件
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
    <staticContent>
      <remove fileExtension=".woff" />
      <mimeMap fileExtension=".woff" mimeType="font/x-woff" />
      <remove fileExtension=".woff2" />
      <mimeMap fileExtension=".woff2" mimeType="font/x-woff2" />
      <remove fileExtension=".ttf" />
      <mimeMap fileExtension=".ttf" mimeType="font/x-ttf" />
      <remove fileExtension=".json" />
      <mimeMap fileExtension=".json" mimeType="text/json" />
    </staticContent>
    <rewrite>
      <rules>
        <rule name="vue" stopProcessing="true">
          <match url=".*" />
          <conditions logicalGrouping="MatchAll">
            <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
          </conditions>
          <action type="Rewrite" url="/" />
        </rule>
      </rules>
    </rewrite>
  </system.webServer>
</configuration>

相关文章

网友评论

      本文标题:IIS 安装部署.net + vue

      本文链接:https://www.haomeiwen.com/subject/yybswdtx.html