分享好的链接,让有价值的东西发光!

这篇博客很好的解释了HOST的作用。

但是在读的过程中还是要进行验证,从技术的源头看看它的本意是什么。
可以看看协议本身的解释,顺便考验一下你的英文能力。

The “Host” header field in a request provides the host and port
information from the target URI, enabling the origin server to
distinguish among resources while servicing requests for multiple
host names on a single IP address.

 Host = uri-host [ ":" port ] ; Section 2.7.1

A client MUST send a Host header field in all HTTP/1.1 request
messages. If the target URI includes an authority component, then a
client MUST send a field-value for Host that is identical to that
authority component, excluding any userinfo subcomponent and its “@”
delimiter (Section 2.7.1). If the authority component is missing or
undefined for the target URI, then a client MUST send a Host header
field with an empty field-value.

Since the Host field-value is critical information for handling a
request, a user agent SHOULD generate Host as the first header field
following the request-line.

For example, a GET request to the origin server for
http://www.example.org/pub/WWW/ would begin with:

 GET /pub/WWW/ HTTP/1.1Host: www.example.org

A client MUST send a Host header field in an HTTP/1.1 request even if
the request-target is in the absolute-form, since this allows the
Host information to be forwarded through ancient HTTP/1.0 proxies
that might not have implemented Host.

When a proxy receives a request with an absolute-form of
request-target, the proxy MUST ignore the received Host header field
(if any) and instead replace it with the host information of the
request-target. A proxy that forwards such a request MUST generate a
new Host field-value based on the received request-target rather than
forward the received Host field-value.

Since the Host header field acts as an application-level routing
mechanism, it is a frequent target for malware seeking to poison a
shared cache or redirect a request to an unintended server. An
interception proxy is particularly vulnerable if it relies on the
Host field-value for redirecting requests to internal servers, or for
use as a cache key in a shared cache, without first verifying that
the intercepted connection is targeting a valid IP address for that
host.

A server MUST respond with a 400 (Bad Request) status code to any
HTTP/1.1 request message that lacks a Host header field and to any
request message that contains more than one Host header field or a
Host header field with an invalid field-value.

什么是HTTP HOST相关推荐

  1. 端口映射问题:Bad Request This combination of host and port requires TLS.

    错误信息: Bad Request This combination of host and port requires TLS. 遇到上面的错误信息:如果是通过域名访问,则该域名后配置的转发端口映射 ...

  2. linux下出现ping:unknown host www.baidu.com问题时的解决办法——ubuntu下局域网络的配置...

    如果ping域名的时候出现ping:unknown host  xxx.xxx 但是ping IP地址的时候可以通的话 可知是dns服务器没有配置好, 查看一下配置文件/etc/resolv.conf ...

  3. Virtual host / experienced an error on node rabbit@wohu-rabbit and may be inaccessible

    RabbitMQ 如下错误: Virtual host / experienced an error on node rabbit@wohu-rabbit and may be inaccessibl ...

  4. HttpUrlConnection底层实现和关于java host绑定ip即时生效的设置及分析

    最近有个需求需要对于获取URL页面进行host绑定并且立即生效,在java里面实现可以用代理服务器来实现:因为在测试环境下可能需要通过绑定来访问测试环境的应用 实现代码如下: public stati ...

  5. Host Only、NAT和Bridge三种网络连接

    Host Only.NAT和Bridge三种网络连接 在安装好了Linux镜像之后,如何连接物理机和虚拟机呢?这就需要网络连接,网络连接有三种:HostOnly.NAT.Bridge,它们都可用于Gu ...

  6. 【Ubuntu】ping: unknown host www.baidu.com

    1.问题描述 每次重新设置网络后,ping百度总是报错: $ ping www.baidu.com ping: unknown host www.baidu.com 2.原因分析 原因是:查看/etc ...

  7. Invalid Host header 问题解决

    出现该问的原因: 因为新版的 webpack-dev-server 出于安全考虑,默认检查 hostname,如果hostname不是配置内的就不能访问. 解决办法:设置跳过host检查 打开你的项目 ...

  8. docker容器网络 - 同一个host下的容器间通信

    2019独角兽企业重金招聘Python工程师标准>>> 对于复杂的应用,不可避免需要多个服务部署在多个容器中,并且服务间存在相互间通信的情况.比如服务A需要连接mysql的容器.本文 ...

  9. expect脚本同步文件、 expect脚本指定host和要同步的文件 、 构建文件分发系统 、批量远程执行命令...

    为什么80%的码农都做不了架构师?>>>    20.31 expect脚本同步文件 使用expect脚本同步文件 说明:核心命令是rsync #! /usr/bin/expect ...

  10. Git error: Unable to negotiate with X.X.X.X : no matching host key type found . their offer: ssh-dss

    2019独角兽企业重金招聘Python工程师标准>>> I am trying to create a git repository on my web host and clone ...

最新文章

  1. 如何用计算机对cad的草图,AutoCAD2020图纸如何导入su草图大师软件?
  2. mysql 连接数测试_mysql最大连接数试验
  3. 两线怎么接三线插座图_什么是RTD热电阻?两线制和三线制RTD有什么不同?
  4. ubuntu之anaconda之编辑器
  5. oracle数据库实践,RubyonRails连接Oracle数据库实践
  6. python封装c++接口_用C++封装MySQL的API的教程
  7. 10深入Redis Cluster
  8. 第2章 数据可视化基础
  9. 「代码随想录」474.一和零【动态规划】力扣详解!
  10. 软件以人为本5 - 敏捷3 - 拯救每日立会2
  11. 为什么祖传代码被称为「屎山」?这个回答简直太形象了
  12. 接口测试用例设计的一点总结
  13. OC代码转Swift代码
  14. 最新版本 release版本 ceph分布式存储搭建(rook-1.8.6)
  15. JS如何判断滚动条是否滚到底部
  16. 05-ET框架的前后端通信1
  17. 自定义excel表格(生成报价单,含多种excel样式调整)
  18. Ubuntu双网卡共享上网 外网 内网
  19. 代码随想录day9|实现strStr()、重复的子字符串
  20. Spring中把一个bean对象交给Spring容器管理的三种方式

热门文章

  1. 基于华为云的在线拍卖数据分析
  2. 直接执行SQL语句的快捷键是什么啊?嘎嘎
  3. php 获取文件夹下面的文件列表和文件夹列表
  4. vue中clearInterval()清除定时器报timeout.close is not a function错误?
  5. android 4.4 flac,如何在Android中将音频原始转换为FLAC
  6. Linux系统的介绍及安装
  7. python爬虫读取pdf_python爬虫处理在线预览的pdf文档
  8. teamviewer存在linux版本_TeamViewer 9发布-在Linux下安装运行
  9. CodePush热更新常用命令与注意事项
  10. Spring全家桶--SpringBoot