mercredi 25 septembre 2019

redirect with web cofing file

I have an application in Java. Built in a war file in port 8085. I must deploy de application in IIS. In this way I have an url www.mydomain.es that enter for port 80 to localhost:8085 and then the web config rewrite de localhost to www.mydomain.es. I have error 500.

This is a Windows Server 2016 running IIS 7

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
    <rewrite>
        <rules>
            <rule name="ReverseProxyInboundRule1" stopProcessing="true">
                <match url="(.*)" />
                <conditions>
                    <add input="{CACHE_URL}" pattern="^(https?)://" />
                </conditions>
                <action type="Rewrite" url="{C:1}://127.0.0.1:8085/{R:1}" />
            </rule>
        </rules>
        <outboundRules>
            <rule name="ReverseProxyOutboundRule1" preCondition="ResponseIsHtml1">
                <match filterByTags="A, Form, Img" pattern="^http(s)?://127.0.0.1:8085/(.*)" />
                <action type="Rewrite" value="http{R:1}://www.mydomain.es/{R:2}" />
            </rule>
            <preConditions>
                <preCondition name="ResponseIsHtml1">
                    <add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" />
                </preCondition>
            </preConditions>
        </outboundRules>
    </rewrite>
    <urlCompression doStaticCompression="true" doDynamicCompression="false" />
</system.webServer>
</configuration>

I have error 500




Aucun commentaire:

Enregistrer un commentaire