小编Sub*_*bbu的帖子

IIS URL 重写 - 反向代理 - 响应 404 错误

基本上我想使用反向代理重写 url: from:

http://www.xyz.in/eacc/api/fetchVendors

http://localhost:8080/eacc/api/fetchVendors

我已经在 C:\Tomcat\apache-tomcat-9.0.7\webapps\eacc 下的 tomcat 中部署了我的 Spring Boot Rest 完整 Web 服务应用程序。

它包含许多 POST 调用,如 /eacc/api/fetchVendors、/eacc/api/users、/eacc/api/clients.. 等。

现在我想通过 IIS 公开这个 eacc rest 应用程序。

配置了名为 www.xyz.in 的主网站。

在名为 /eacc 的网站 (www.xyz.in) 下添加了虚拟目录。物理路径:C:\inetpub\wwwroot\eacc 下面是 web.config 文件。

当我尝试打一个像www.xyz.in/eacc/api/fetchVendors这样的帖子调用时,得到 HTTP 404 服务器错误。

描述:HTTP 404。您要查找的资源(或其依赖项之一)可能已被删除、更改名称或暂时不可用。请检查以下 URL 并确保其拼写正确。

请求的网址:/eacc/api/fetchVendors

我的/eacc 的web.config 文件- 虚拟目录

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <httpRedirect enabled="false" />
        <rewrite>
            <rules>
                <rule name="ReverseProxyInboundRule1" stopProcessing="true">
                    <match url="(.*)" />
                    <action type="Rewrite" url="http://localhost:8080/eacc/{R:1}" />
                </rule> …
Run Code Online (Sandbox Code Playgroud)

rest reverse-proxy url-rewriting iis-10 tomcat9

2
推荐指数
1
解决办法
3455
查看次数

标签 统计

iis-10 ×1

rest ×1

reverse-proxy ×1

tomcat9 ×1

url-rewriting ×1