通过在虚拟机根目录下的web.config文件中添加以下配置即可使用https,具体方法如下:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="301" stopProcessing="true">
<match url="^(.*)$" ignoreCase="false" />
<conditions logicalGrouping="MatchAll">
<add input="{HTTP_FROM_HTTPS}" pattern="^on$" negate="true" />
</conditions>
<action type="Redirect" url="https://www.baidu.com/{R:1}" redirectType="Permanent" /> # www.baidu.com对应修改为您自已的域名,注释请自行删除,不要放入web.config文件内
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
辰迅云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>
推荐阅读: VMware如何关闭ubuntu虚拟机