本文介绍了IIS将端口8880上的http重定向到端口8443上的https的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

我在这里很挣扎.我已经看到了很多关于80到443的答案,但是我的控制面板确实受困于8880到8443.

I am rather struggling here. I've seen lots of answers for 80 to 443, but I'm really stuck with 8880 to 8443 for our control panel.

需要重定向的URL示例:http://udweb01.servers.unreal-designs.co.uk:8880/admin/home?context=home

An example of a URL that needs redirecting: http://udweb01.servers.unreal-designs.co.uk:8880/admin/home?context=home

其结果应为: https://udweb01.servers.unreal-designs.co.uk:8443/admin/home?context=home

请注意http-> https和8880-> 8443.

Note the http -> https and 8880 -> 8443.

我们当前的规则是:

<rule name="Force SSL (8443)" enabled="true" stopProcessing="true">
  <match url="^(http://)?(.*):8880(/.*)?$" />
  <action type="Redirect" url="https://{R:2}:8443{R:3}" appendQueryString="true" redirectType="Found" />
</rule>

但这似乎无济于事.有什么想法吗?

But that doesn't seem to do anything. Any ideas?

推荐答案

您的规则应如下:

<rule name="Redirect with port" stopProcessing="true">
     <match url=".*" />
     <conditions>
          <add input="{HTTP_HOST}" pattern="^(.*):8880$" />
     </conditions>
     <action type="Redirect" url="https://{C:1}:8443/{R:0}" />
</rule>

在此规则中,您具有条件< add input ="{HTTP_HOST}" pattern ="^(.*):8880 $"/> ,它将仅接受端口为8880的http主机

In this rule you have condition <add input="{HTTP_HOST}" pattern="^(.*):8880$" /> which will accet only http host with port 8880

这篇关于IIS将端口8880上的http重定向到端口8443上的https的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-08 13:23