专业网站建设品牌,十四年专业建站经验,服务6000+客户--广州京杭网络
免费热线:400-683-0016      微信咨询  |  联系我们

VUE 项目单独部署在IIS的时候WebConfig配置方法

当前位置:网站建设 > 技术支持
资料来源:网络整理       时间:2023/2/14 1:10:59       共计:3662 浏览

当VUE项目以二级目录的形式部署正在IIS的时候,直接上代码(web.config):


<configuration>

<system.webServer>

<rewrite>

<rules>

<rule name="Handle History Mode and custom 404/500" stopProcessing="false">

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

       <staticContent>

           <mimeMap fileExtension=".svg" mimeType="image/svg+xml" />

       </staticContent>

</system.webServer>

</configuration>


再来一个多个反向代理时候的WebConfig配置信息


<?xml version="1.0" encoding="UTF-8"?>

<configuration>

 <system.webServer>

   <rewrite>

     <rules>

               <clear />

               <rule name="upload" enabled="true" patternSyntax="Wildcard" stopProcessing="true">

                   <match url="*Upload/*" />

                   <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />

                   <action type="Rewrite" url="http://localhost:5010/Upload/{R:2}" />

               </rule>

               <rule name="api" enabled="true" patternSyntax="Wildcard" stopProcessing="true">

                   <match url="*api/*" />

                   <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />

                   <action type="Rewrite" url="http://localhost:5010/api/{R:2}" />

               </rule>

               <rule name="hubs" enabled="true" patternSyntax="Wildcard" stopProcessing="true">

                   <match url="*hubs/*" />

                   <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />

                   <action type="Rewrite" url="http://localhost:5010/hubs/{R:2}" />

               </rule>

               <rule name="index" stopProcessing="true">

                   <match url="^((?!(api)).)*$" />

                   <conditions logicalGrouping="MatchAll" trackAllCaptures="false">

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

版权说明:
本网站凡注明“广州京杭 原创”的皆为本站原创文章,如需转载请注明出处!
本网转载皆注明出处,遵循行业规范,如发现作品内容版权或其它问题的,请与我们联系处理!
欢迎扫描右侧微信二维码与我们联系。
·上一条:教你该怎样提升网站流量 | ·下一条:使用nginx部署Vue项目,刷新出现404

Copyright © 广州京杭网络科技有限公司 2005-2025 版权所有    粤ICP备16019765号 

广州京杭网络科技有限公司 版权所有