iis-express - 将 SSL 与 IIS Express 一起使用
问题描述
我正在尝试使用假域名(bobby.fisher.com)在 localhost 上运行我的 VS 项目。为此,我在 applicationhost.config 文件中创建了一个虚拟目录,如下所示:
<site name="Tidywork.Integrations.Web" id="2">
<application path="/" applicationPool="Clr4IntegratedAppPool">
<virtualDirectory path="/" physicalPath="C:\bobbyfisher\Workspaces\bobbyfisher.Integrations\bobbyfisher.Integrations\bobbyfisher.Integrations.Web" />
</application>
<bindings>
<binding protocol="http" bindingInformation="*:35464:localhost" />
<binding protocol="http" bindingInformation="*:80:bobby.fisher.com" />
<binding protocol="https" bindingInformation="*:44321:localhost" />
<binding protocol="https" bindingInformation="*:44321:bobby.fisher.com" />
</bindings>
</site>
但是,当我尝试运行程序(https://bobby.fisher.com/)时,我遇到了一个错误:
This site can’t be reached
bobby.fisher.com refused to connect.
Try:
Checking the connection
Checking the proxy and the firewall
ERR_CONNECTION_REFUSED
有没有人有任何建议如何做到这一点?
解决方案
如果您在访问站点时未在 URL 中指定端口,那么如果您选择https://
(根据您的示例)浏览器将尝试自动连接端口 443 - 因为这是 HTTPS 的标准端口。
但是您尚未在 IIS 设置中配置该端口。因此,要么将该端口绑定到您的应用程序的 https,要么在您的 URL 中明确使用端口号(例如https://bobby.fisher.com:44321
)
推荐阅读
- postgresql - 应该使用什么数据类型在 postgres 中存储固定的月费金额?
- sql - 如何在前 2 位后获得小数点?
- graph - 针对特定问题优化 dijkstra 算法
- reactjs - 反应 onclick 监听器
- c++ - 如何修复'=='操作数中比较周围的建议括号
- database - 如何合并这两个 MDB 数据库
- javascript - 在 Node 应用程序中使用 AND 使用 Knex.js 构造内部连接
- azure-devops - 如何在 Azure 管道上仅在 PR 上而不是在合并后触发构建?
- html - 带有“向左浮动”的框的 Flex wrap 布局 - 使最后一行框的宽度与其余框相同
- regex - 有没有办法有条件地替换字符串中的第一个'/'?