Azure应用服务与https

huangapple go评论68阅读模式
英文:

Azure Appservice with https

问题

我在部署到 Azure 应用服务的 Spring 应用程序中启用了“仅限 HTTPS”选项。然而,我仍然可以使用 HTTP 进行调用。它并未要求/阻止我使用 HTTP。有任何想法原因是什么?

http://myapp.azurewebsites.net/api/v4/callers/ping. // 这个能够正常工作

Jdk11
spring boot

英文:

I turned HTTPS Only option on for my Spring application that I deployed to Azure App service. However, I still can make calls with http. It does not require/stop me using http. Any idea why?

http://myapp.azurewebsites.net/api/v4/callers/ping. // This perfectly works fine

Jdk11
spring boot

答案1

得分: 1

Http only选项并不意味着它会阻止HTTP请求。相反,它会将HTTP请求重定向到HTTPS请求。有关详细信息,请参阅此处

您可以使用浏览器的开发工具轻松测试此行为。例如,打开一个浏览器(如Chrome)-> 按F12键打开开发工具 -> 输入以http://xxx开头的URL -> 然后检查开发工具中的跟踪 -> 您会看到有2个跟踪,第一个是HTTP,第二个是HTTPS。截图如下:

Azure应用服务与https

英文:

Http only options does not mean it will block the http requests. Instead, it will redirect the http requests to https request. See here for the details.

You can simple test this behavior by using the develop tool of the browser. For example, open a browswer(like chrome) -> press F12 button to open the develop tool -> input the url starts with http://xxx -> then check the traces in the develop tool -> you can see there're 2 traces, the first is for http, and the 2nd is for https. The screenshot is as below:

Azure应用服务与https

答案2

得分: 0

似乎您的网站出现了问题。
如果您设置了https_only:true,Azure应该会自动将您的HTTP请求重定向到HTTPS。
您可以通过查看地址栏开头的“锁”图标来验证这一点。

英文:

Looks like your site is down.
Azure should automatically redirect your http req to https if you have set https_only:true.

You can verify this by looking at the "lock" icon at the start of your address bar.

huangapple
  • 本文由 发表于 2020年10月21日 04:10:44
  • 转载请务必保留本文链接:https://go.coder-hub.com/64452659.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定