windows 主机文件和查看站点是 https

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4875690/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 16:06:47  来源:igfitidea点击:

Hosts file and viewing sites which are https

windowshttpsiis-6

提问by TheAlbear

I have a windows server behind a NAT, so in order to view any of the sites the server is running I have a hosts file setup to point to point back to the right internal IP.

我在 NAT 后面有一个 Windows 服务器,所以为了查看服务器正在运行的任何站点,我有一个主机文件设置来指向指向正确的内部 IP。

e.g.

例如

127.0.0.1       localhost
192.168.0.1     www.mydomain.com

This is all fine and I can view the site www.mydomain.com on the local machine.

这一切都很好,我可以在本地机器上查看网站 www.mydomain.com。

This issue I am having is that I cant view the https of the site on the local machine e.g. https://www.mydomain.comreturns an error, that it cant connect.

我遇到的这个问题是我无法在本地机器上查看站点的 https,例如https://www.mydomain.com返回一个错误,它无法连接。

From any webbroswer outside the server enviroment it all works fine its just when I go to view the site view on the local machine.

从服务器环境之外的任何网络浏览器,当我去查看本地机器上的站点视图时,一切正常。

What should I be adding to the hosts file / doing to make the site connect locally over SSL?

我应该向主机文件添加什么/做什么才能使站点通过 SSL 本地连接?

采纳答案by Georgi

Nothing more should be added to hosts file. Just configure your IIS server to server https as well.

不应向主机文件添加更多内容。只需将您的 IIS 服务器也配置为服务器 https。

http://support.microsoft.com/kb/324069

http://support.microsoft.com/kb/324069