I have an IIS 10 with ARR 3.0 and websockets
If I'm using directly iis, my websockets works great.
The websocket's address is like ws://IP_SERVER:PORT/ws/XXXX
If I'm using the same iis (and same site with a rewrite url rule) as reverse proxy, my websocket connects and disconnects forever.
The websocket's address is like ws://DOMAIN:PORT/ws/XXXX
The Url Rewrite configuration is:
<rewrite>
<rules>
<rule name="ReverseProxyInboundRule1" stopProcessing="true">
<match url="(.*)" />
<action type="Rewrite" url="{C:1}://localhost:1880/{R:1}" />
<conditions>
<add input="{CACHE_URL}" pattern="^(.+)://" />
</conditions>
</rule>
</rules>
</rewrite>
Can you help me please ?
Thanks
Related
I am having trouble wrestling url rewrite and need to handle this in IIS. What I need is to ensure that all traffic that hits the server is redirected to https://server/app. I can handle this using a standard http to https rewrite which seems to work fine redirecting http://server to https://server/app but it doesn't work if someone hits https://server.
Here's my standard rewrite:
<rewrite>
<rules>
<rule name="http to https" enabled="false" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="^OFF$" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}/app" />
</rule>
</rules>
</rewrite>
I am using URL rewrite to try and set up a rewrite from one site to the another site. I used URL re-write to set up this rule:
<httpRedirect enabled="false" destination="https://www.previdence.com" exactDestination="false" />
<rewrite>
<rules>
<rule name="SiteRedirect" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="^OFF$" />
</conditions>
<action type="Redirect" url="https://www.previdence.com" appendQueryString="false" />
</rule>
</rules>
</rewrite>
I have followed a couple of tutorials on setting this up and this is what should be set. So if I type in companyname.net it will redirect to https://www.companyname.com. If I type in https://www.companyname.net or https://companyname.net it goes to a 404.
Looking at the bindings for the old site there are bindings for PORT 443 and PORT 80 for www.companyname.net. I set the redirect in IIS for code 302, then I got URL rewrite as I explained above and I still get a 404 error.
We have applications hosted on WebSphere 7.0 and Jboss EAP7 which is behind IIS 8.5 Web server, we enabled ssl for iis.
our requirement is whenever users access with http it has to be redirected to https, to achieve this we configured rewrite2 module in iis below inbound rule
<rules>
<rule name="http to https" enabled="false" stopProcessing="true">
<match url="(.*)" />
<conditions logicalGrouping="MatchAny">
<add input="{HTTPS}" pattern="^OFF$" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" redirectType="SeeOther" />
</rule>
issue :- when i access http://www.example.com/login it redirects to https://www.example.com/sePlugins/iisWASPlugin_http.dll and gives 404 Status code. (only applications hosted websphere)
The problem is that we have a ISAPI Websphere plugin to handle the requests and for some reason URL is getting changed by IIS.
redirect rule works fine for Applications hosted on J BOSS.
Not sure what happened to my registration process but I posted the original answer so reposting again after registering.
I found that specifying {CACHE_URL} in the Redirect Url instead of https://{HTTP_HOST}{REQUEST_URI} worked. so url="{CACHE_URL}"
This is how my rule is defined and it seems to work well.
<rule name="HTTP to HTTPS redirect" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTP_X_FORWARDED_PROTO}" pattern="^http$" />
</conditions>
<action type="Redirect" url="{CACHE_URL}" />
</rule>
I found that specifying {CACHE_URL} in the Redirect Url instead of https://{HTTP_HOST}{REQUEST_URI} worked. so url="{CACHE_URL}"
I want to redirect anything to https://domain.com
I found this code:
<rewrite>
<rules>
<rule name="SecureRedirect" stopProcessing="true">
<match url="^(.*)$" />
<conditions>
<add input="{HTTPS}" pattern="off" />
<add input="{HTTP_HOST}" pattern="^(www\.)?(.*)$" />
</conditions>
<action type="Redirect" url="https://{C:2}" redirectType="Permanent" />
</rule>
</rules>
</rewrite>
And its working except on https://www.domain.com
My virtual server is Windows Server 2012 with IIS 8, and the domain is https://kajsystem.com
I would suggest using IIS 8 configurations including using the URL Rewrite module, which can handle forwarding and retain the entire requested URL. There is a fairly comprehensive article on MSDN site covering this:
MSDN redirect on IIS 7 and higher
I use IIS 7.5
I have a website wich has a valid host like:
A) mysite.co.uk
and a DEFAULT host (using for testing proposes provided by the hosting company):
B) mysite.hosting.com
Website is visible on both address, creating a DUPLICATE CONTENT issue for Search Engine.
I need redirect all the traffic (for all pages) from B to A using a 301 redirect.
IIS7.5 Http Redirect it is not design for this situation so I suppose to use IIS 7.5 Url Rewrite Module.
My questions: how write the ROLE in my web.config? Thanks
Try adding something like this between the <System.webServer> tags in your web.config:
<rewrite>
<rules>
<rule name="Redirect mysite.hosting.com to mysite.co.uk" patternSyntax="Wildcard" stopProcessing="true">
<match url="*" />
<conditions>
<add input="{HTTP_HOST}" pattern="mysite.hosting.com" />
</conditions>
<action type="Redirect" url="http://mysite.co.uk/{R:0}" />
</rule>
</rules>
</rewrite>
Alternatively, you can do this using global rules by adding:
<rewrite>
<globalRules>
<rule name="Redirects to mysite.co.uk" patternSyntax="ECMAScript" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAny">
<add input="{HTTP_HOST}" pattern="mysite.hosting.com$" />
</conditions>
<action type="Redirect" url="http://mysite.co.uk/{R:0}" />
</rule>
</globalRules>
</rewrite>