basically i wanna to rewrite url using reverse proxy: from:
http://www.xyz.in/eacc/api/fetchVendors
to
http://localhost:8080/eacc/api/fetchVendors
I have deployed my spring boot rest full web service application in tomcat under C:\Tomcat\apache-tomcat-9.0.7\webapps\eacc.
It contains many POST call like /eacc/api/fetchVendors, /eacc/api/users, /eacc/api/clients.. etc.
Now i wanna to expose this eacc rest application through IIS.
have main website configured called www.xyz.in.
added virtual directory under website (www.xyz.in) called /eacc. physical path: C:\inetpub\wwwroot\eacc below is web.config file.
When i try to hit one post call like www.xyz.in/eacc/api/fetchVendors, getting HTTP 404 server error.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
Requested URL: /eacc/api/fetchVendors
My web.config file for /eacc - virtual directory
<?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>
</rules>
<outboundRules>
<rule name="ReverseProxyOutboundRule1" preCondition="ResponseIsHtml1">
<match filterByTags="A, Form, Img" pattern="^http(s)?://localhost:8080/eacc/(.*)" />
<action type="Rewrite" value="http{R:1}://www.xyz.in/{R:2}" />
</rule>
<preConditions>
<preCondition name="ResponseIsHtml1">
<add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/(.+)" />
</preCondition>
</preConditions>
</outboundRules>
</rewrite>
</system.webServer>
</configuration>
Am new to IIS web server.have stuck with URL Rewrite reverse proxy pattern. have tried many pattern changes but no luck. Looking help from anyone.