开了443端口之后需不需要再打开80端口?
Copyright Notice: This article is an original work licensed under the CC 4.0 BY-NC-ND license.
If you wish to repost this article, please include the original source link and this copyright notice.
Source link: https://v2know.com/article/3
可以同时打开80端口和443端口。
打开的话,80端口最好做一下重定向,如果你是IIS的话,
IIS管理中SSL设置的“需要SSL”需要勾选,这样当访问不是http的页面时就会先跳转到403错误页面,然后再跳转到https页面
在C:\inetpub\custerr\zh-CN 下,
对403报错的页面的内容进行替换,(注意最好备份一下这个文件)
将403里面的内容全部替换为以下:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="HTTP to HTTPS redirect" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="off" ignoreCase="true" />
</conditions>
<action type="Redirect" redirectType="Found" url="https://{HTTP_HOST}/{R:1}" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
This article was last edited at 2020-02-15 07:25:02