Originalmente publicado por jquilezl
Ver Mensaje
Tengo los cuatro servers montados, uno que hace de frontend con el ARR instalado. Los otros tres con IIS. En uno de éstos he instalado php, pero me queda completar la configuración.
Llevo media tarde liado con el ARR. Los documentos que hay por Internet no son muy explicativos que digamos. He creado reglas de url rewrite, configurándoles condiciones de tipo {HTTP_HOST} con patrón coindidente con la url pública que quiero redirigir (p.e. http://www.gericom.es*) y acción Redirigir a "http://srvinternal01.servers.es", y así para los tres, pero no me funciona (la url interna es alcanzable si la tecleo directamente). También he probado en lugar de esto a crear tres granjas de un servidor (el srvinternalxx correspondiente) y en lugar de redirigir, decirle que la acción de cada regla es enrutar a la granja correspondiente.
Ahora no puedo seguir; me parece que mañana borraré toda la configuración del server frontend y volveré a empezar. Alguna pistilla se agradecería, pues seguro que me estoy dejando algo que luego será evidente.
Llevo media tarde liado con el ARR. Los documentos que hay por Internet no son muy explicativos que digamos. He creado reglas de url rewrite, configurándoles condiciones de tipo {HTTP_HOST} con patrón coindidente con la url pública que quiero redirigir (p.e. http://www.gericom.es*) y acción Redirigir a "http://srvinternal01.servers.es", y así para los tres, pero no me funciona (la url interna es alcanzable si la tecleo directamente). También he probado en lugar de esto a crear tres granjas de un servidor (el srvinternalxx correspondiente) y en lugar de redirigir, decirle que la acción de cada regla es enrutar a la granja correspondiente.
Ahora no puedo seguir; me parece que mañana borraré toda la configuración del server frontend y volveré a empezar. Alguna pistilla se agradecería, pues seguro que me estoy dejando algo que luego será evidente.
Spoiler: mostrar
Código:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="ReverseProxyInboundRule4" stopProcessing="true">
<match url="(.*)" />
<action type="Rewrite" url="http://192.168.4.162/{R:1}" />
<conditions>
<add input="{HTTP_HOST}" pattern="rkey.es" />
</conditions>
<serverVariables>
<set name="HTTP_X_ORIGINAL_ACCEPT_ENCODING" value="{HTTP_ACCEPT_ENCODING}" />
<set name="HTTP_ACCEPT_ENCODING" value="" />
</serverVariables>
</rule>
<rule name="ReverseProxyInboundRule3f" stopProcessing="true">
<match url="(.*)" />
<action type="Rewrite" url="https://jmtella.com/foro/{R:1}" />
<conditions>
<add input="{HTTP_HOST}" pattern="foro.jmtella.com" />
</conditions>
<serverVariables>
<set name="HTTP_X_ORIGINAL_ACCEPT_ENCODING" value="{HTTP_ACCEPT_ENCODING}" />
<set name="HTTP_ACCEPT_ENCODING" value="" />
</serverVariables>
</rule>
<rule name="ReverseProxyInboundRule3fs" stopProcessing="true">
<match url="(.*)" />
<action type="Rewrite" url="https://jmtella.com/foro/{R:1}" />
<conditions>
<add input="{HTTP_HOST}" pattern="foros.jmtella.com" />
</conditions>
<serverVariables>
<set name="HTTP_X_ORIGINAL_ACCEPT_ENCODING" value="{HTTP_ACCEPT_ENCODING}" />
<set name="HTTP_ACCEPT_ENCODING" value="" />
</serverVariables>
</rule>
<rule name="ReverseProxyInboundRule3fsn" stopProcessing="true">
<match url="(.*)" />
<action type="Rewrite" url="https://jmtella.com/foro/{R:1}" />
<conditions>
<add input="{HTTP_HOST}" pattern="wnews.jmtella.com" />
</conditions>
<serverVariables>
<set name="HTTP_X_ORIGINAL_ACCEPT_ENCODING" value="{HTTP_ACCEPT_ENCODING}" />
<set name="HTTP_ACCEPT_ENCODING" value="" />
</serverVariables>
</rule>
<rule name="ReverseProxyInboundRule3" stopProcessing="true">
<match url="(.*)" />
<action type="Rewrite" url="http://192.168.4.158/{R:1}" />
<conditions>
<add input="{HTTP_HOST}" pattern="foros.jmtella.es" />
</conditions>
<serverVariables>
<set name="HTTP_X_ORIGINAL_ACCEPT_ENCODING" value="{HTTP_ACCEPT_ENCODING}" />
<set name="HTTP_ACCEPT_ENCODING" value="" />
</serverVariables>
</rule>
<rule name="ReverseProxyInboundRule2" stopProcessing="true">
<match url="(foro.*|oficina.*)" />
<action type="Rewrite" url="http://192.168.4.57/{R:1}" />
<conditions>
<add input="{CACHE_URL}" pattern="^(https?)://" />
</conditions>
<serverVariables>
<set name="HTTP_X_ORIGINAL_ACCEPT_ENCODING" value="{HTTP_ACCEPT_ENCODING}" />
<set name="HTTP_ACCEPT_ENCODING" value="" />
</serverVariables>
</rule>
<rule name="ReverseProxyInboundRule1" stopProcessing="true">
<match url="(.*)" />
<action type="Rewrite" url="http://192.168.4.138/{R:1}" />
<conditions>
<add input="{CACHE_URL}" pattern="^(https?)://" />
</conditions>
<serverVariables>
<set name="HTTP_X_ORIGINAL_ACCEPT_ENCODING" value="{HTTP_ACCEPT_ENCODING}" />
<set name="HTTP_ACCEPT_ENCODING" value="" />
</serverVariables>
</rule>
</rules>
<outboundRules>
<rule name="ReverseProxyOutboundRule4" preCondition="ResponseIsHtml1">
<match filterByTags="A, Area, Base, Form, Frame, Head, IFrame, Img, Input, Link, Script" pattern="^http(s)?://192.168.4.162/(.*)" />
<action type="Rewrite" value="http{R:1}://rkey.es/{R:2}" />
</rule>
<rule name="ReverseProxyOutboundRule3" preCondition="ResponseIsHtml1">
<match filterByTags="A, Area, Base, Form, Frame, Head, IFrame, Img, Input, Link, Script" pattern="^http(s)?://192.168.4.158/(.*)" />
<action type="Rewrite" value="http{R:1}://foros.jmtella.es/{R:2}" />
</rule>
<rule name="ReverseProxyOutboundRule1" preCondition="ResponseIsHtml1">
<match filterByTags="A, Area, Base, Form, Frame, Head, IFrame, Img, Input, Link, Script" pattern="^http(s)?://192.168.4.138/(.*)" />
<action type="Rewrite" value="http{R:1}://jmtella.com/{R:2}" />
</rule>
<rule name="ReverseProxyOutboundRule2" preCondition="ResponseIsHtml1">
<match filterByTags="A, Area, Base, Form, Frame, Head, IFrame, Img, Input, Link, Script" pattern="^http(s)?://192.168.4.57/(.*)" />
<action type="Rewrite" value="http{R:1}://jmtella.com/{R:2}" />
</rule>
<rule name="RestoreAcceptEncoding" preCondition="NeedsRestoringAcceptEncoding">
<match serverVariable="HTTP_ACCEPT_ENCODING" pattern="^(.*)" />
<action type="Rewrite" value="{HTTP_X_ORIGINAL_ACCEPT_ENCODING}" />
</rule>
<preConditions>
<preCondition name="ResponseIsHtml1">
<add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" />
</preCondition>
<preCondition name="NeedsRestoringAcceptEncoding">
<add input="{HTTP_X_ORIGINAL_ACCEPT_ENCODING}" pattern=".+" />
</preCondition>
</preConditions>
</outboundRules>
</rewrite>
<httpErrors>
<remove statusCode="404" subStatusCode="-1" />
<error statusCode="404" prefixLanguageFilePath="" path="https://jmtella.com/jmt" responseMode="Redirect" />
</httpErrors>
</system.webServer>
</configuration>
Dejar un comentario: