IIS
IIS Crypto Tool
讓 IIS 網站保持運作狀態

image 
image 
image
讓 IIS Express 外部存取
403. Forbidden
透過 URL Rewrite 來實作 cookie 重導
Last updated



Last updated
netsh http add urlacl url=http://10.211.55.3:49486/ user=everyone netsh http delete urlacl url=http://10.211.55.3:49486 <site name="GSS.Duck.WebApi" id="2">
<application path="/" applicationPool="Clr4IntegratedAppPool">
<virtualDirectory path="/" physicalPath="Z:\Workspace\BizForm\duck\src\GSS.Duck.WebApi" />
</application>
<bindings>
<binding protocol="http" bindingInformation="*:49486:localhost" />
+ <binding protocol="http" bindingInformation="*:49486:10.211.55.4" />
</bindings>
</site> netsh advfirewall firewall add rule name="Demo IIS Express" protocol=TCP dir=in localport=49486 action=allow<rewrite>
<rules>
<!-- Rule to conditionally remove "backend" based on a cookie -->
<rule name="Conditional Remove Backend from URL" stopProcessing="true">
<match url="^backend/(.*)" ignoreCase="true" />
<conditions>
<add input="{HTTP_COOKIE}" pattern="x-ms-routing-name=self" />
</conditions>
<action type="Rewrite" url="staging/{R:1}" />
</rule>
<!-- Rules for cookie-based routing to staging and preview -->
<rule name="Route to Staging" stopProcessing="true">
<match url="^backend/(.*)" />
<conditions>
<add input="{HTTP_COOKIE}" pattern="x-ms-routing-name=staging" />
</conditions>
<action type="Rewrite" url="staging/{R:1}" />
</rule>
<rule name="Route to Preview" stopProcessing="true">
<match url="^backend/(.*)" />
<conditions>
<add input="{HTTP_COOKIE}" pattern="x-ms-routing-name=preview" />
</conditions>
<action type="Rewrite" url="preview/{R:1}" />
</rule>
<rule name="Route to Production" stopProcessing="true">
<match url="^backend/(.*)" />
<conditions>
<add input="{HTTP_COOKIE}" pattern="x-ms-routing-name=production" />
</conditions>
<action type="Rewrite" url="production/{R:1}" />
</rule>
</rules>
</rewrite>