1.閲嶅畾鍚戯細http杞琱ttps

<rule name="reto https" stopProcessing="true"> 
  <match url="(.*)"/>  
  <conditions> 
    <add input="{HTTPS}" pattern="off" ignoreCase="true"/> 
  </conditions>  
  <action type="Redirect" redirectType="Found" url="https://{HTTP_HOST}/{R:1}"/> 

</rule>


2.閲嶅啓锛氬弽鍚戜唬鐞嗭紝iis閮ㄧ讲vue鍓嶅悗绔垎绂婚」鐩

鎸囧畾棣栭〉

<rule name="exclude the path" enabled="true" patternSyntax="Wildcard" stopProcessing="true"> 
  <match url="*"/>  
  <conditions logicalGrouping="MatchAll" trackAllCaptures="false"> 
    <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true"/>  
    <add input="{HTTP_ACCEPT}" pattern="application/json*" negate="true"/>  
    <add input="{CONTENT_TYPE}" pattern="multipart/form-data*" negate="true"/> 
  </conditions>  
  <action type="Rewrite" url="/index.html" logRewrittenUrl="true"/>  
  <serverVariables></serverVariables> 

</rule>


 鍗曠嫭鏂囦欢鏈嶅姟鍣

<rule name="files" stopProcessing="true"> 
  <match url="^(.*)"/>  
  <conditions logicalGrouping="MatchAny" trackAllCaptures="false"> 
    <add input="{CONTENT_TYPE}" pattern="^multipart/form-data"/> 
  </conditions>  
  <action type="Rewrite" url="https://file.xxx.com/{R:1}"/> 

</rule>


 鏅氭暟鎹紙ajax涓嬮氳繃json浼犺緭锛

 
<rule name="ajax" stopProcessing="true"> 
  <match url="^(.*)"/>  
  <conditions logicalGrouping="MatchAny" trackAllCaptures="false"> 
    <add input="{CONTENT_TYPE}" pattern="^application/json"/>  
    <add input="{HTTP_ACCEPT}" pattern="^application/json"/> 
  </conditions>  
  <action type="Rewrite" url="https://api.xxx.com/{R:1}"/> 
</rule>
 


浠ヤ笂灏辨槸缃戠珯鏈嶅姟鍣↖IS涓紝web.config 閲嶅啓瑙勫垯鐨勮缁嗗唴瀹癸紝鏇村淇℃伅璇峰叧娉∣D浜戝叾瀹冪浉鍏虫枃绔狅紒



鏈枃URL锛http://www.odweb.cn/news_show.html?id=226