zhizhijie
11 小时以前 fbc1c1590e7e81a550beb50c7cf65c663c7c5b41
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<?xml version="1.0" encoding="UTF-8"?>
<!--
  IIS 反向代理配置(放到 IIS 网站物理根目录,重命名为 web.config)
  前置条件:已安装 URL Rewrite 2.0 + Application Request Routing (ARR) 3.0,
            并在 IIS 管理器 - 服务器节点 - Application Request Routing Cache - Server Proxy Settings 勾选 Enable proxy。
  作用:/api/** 转发到本机后端 8090(java -jar),其余请求由 IIS 静态托管前端 dist。
-->
<configuration>
  <system.webServer>
    <rewrite>
      <rules>
        <rule name="api-reverse-proxy" stopProcessing="true">
          <match url="^api/(.*)" />
          <action type="Rewrite" url="http://localhost:8090/api/{R:1}" />
        </rule>
      </rules>
    </rewrite>
  </system.webServer>
</configuration>