当前位置: 首页 > news >正文

河南省内 在哪个网站做商检表佛山百度快速排名优化

河南省内 在哪个网站做商检表,佛山百度快速排名优化,做内贸哪个网站找客户,wordpress simplicity目录 1. 引言2. HTTP server的配置3. Stream server的配置3.1 作为proxy_protocol的前端服务器3.2 作为proxy_protocol的后端服务器1. 引言 proxy_protocol 是haproxy开发的一种用于在代理服务器和后端服务器之间传递客户端连接信息的协议。使用 proxy_protocol 的主要优势是能…

目录

  • 1. 引言
  • 2. HTTP server的配置
  • 3. Stream server的配置
    • 3.1 作为proxy_protocol的前端服务器
    • 3.2 作为proxy_protocol的后端服务器

1. 引言

  proxy_protocol 是haproxy开发的一种用于在代理服务器和后端服务器之间传递客户端连接信息的协议。使用 proxy_protocol 的主要优势是能够准确地获取客户端的真实 IP 地址,而不受代理服务器的影响。这对于需要根据客户端 IP 地址进行访问控制、日志记录等操作的应用程序非常有用。目前有v1和v2两个版本。详细文件可以参见:https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt

  proxy_protocol协议在一些主流的服务器上面得到了广泛的应用,如tomcat、mariadb、apache、HAPROXY等等。本文要介绍如何在nginx中开启对proxy_protocol的支持。

  nginx对于proxy_protocol协议的支持在HTTP服务和Stream代理服务上面是不一样的。对于前者它只能作为后端服务,支持利用proxy_protocol协议来获取客户端的IP。而对于stream代理,它则是作为前端来发起proxy_protocol的握手的。

2. HTTP server的配置

  对于http协议下的典型架构如下图:

在这里插入图片描述

  其中负载均衡服务器负责封装proxy_protocol报文传递客户端的信息,nginx服务器负责解析proxy_protocol的协议信息来获取客户端的信息,而应用服务器可以有或者没有,对于静态内容可能就只要nginx提供服务就可以了,而动态内容则需要应用服务器来负责。

  下面是给nginx的HTTP服务开启proxy_protocol功能支持的配置,如下:

http {log_format combined '$proxy_protocol_addr - $remote_user [$time_local] ''"$request" $status $body_bytes_sent ''"$http_referer" "$http_user_agent"';#...server {server_name localhost;listen 80   proxy_protocol;listen 443  ssl proxy_protocol;ssl_certificate      /etc/nginx/ssl/public.example.com.pem;ssl_certificate_key  /etc/nginx/ssl/public.example.com.key;location /app/ {proxy_pass       http://backend1;proxy_set_header Host            $host;proxy_set_header X-Real-IP       $proxy_protocol_addr;proxy_set_header X-Forwarded-For $proxy_protocol_addr;}}
}

  其中两个listen语句中均添加了"proxy_protocol"的属性,表示对于监听的端口,在新建连接的时候会进行proxy_protocol协议的握手处理。
  对于下面这两行配置:

	proxy_set_header X-Real-IP       $proxy_protocol_addr;proxy_set_header X-Forwarded-For $proxy_protocol_addr;

  则用于告诉nginx在发起向后端应用服务器发起请求的时候,会在HTTP请求头中添加X-Real-IP和X-Forwarded-For两个请求头,并都设置其为通过解析Proxy protocol协议头中得到的客户端的真实地址“$proxy_protocol_addr"。

  最后,对于访问日志,也会记录客户端的真实IP地址,如下:

    log_format combined '$proxy_protocol_addr - $remote_user [$time_local] ''"$request" $status $body_bytes_sent ''"$http_referer" "$http_user_agent"';

  在访问日志的格式模板里面也设置了$proxy_protocol_addr 变量用来获取客户端的真实IP。

  至此,nginx就能够在收到http请求的时候首先进行proxy_protocol的握手。当然,在开启proxy_protocol协议支持的时候,请确保nginx的前端也同样配置了proxy_protocol协议,否则nginx会无法正好工作。
  这可以通过下面nginx源码得到证明:


文章转载自:
http://tidings.xsfg.cn
http://ruined.xsfg.cn
http://poromeric.xsfg.cn
http://squirt.xsfg.cn
http://dada.xsfg.cn
http://complexionless.xsfg.cn
http://phytoclimatology.xsfg.cn
http://pirineos.xsfg.cn
http://lamplit.xsfg.cn
http://actium.xsfg.cn
http://hoofed.xsfg.cn
http://tempering.xsfg.cn
http://micros.xsfg.cn
http://scorcher.xsfg.cn
http://epirogeny.xsfg.cn
http://gametocide.xsfg.cn
http://delint.xsfg.cn
http://thailand.xsfg.cn
http://alfafoetoprotein.xsfg.cn
http://exsuccous.xsfg.cn
http://hypomotility.xsfg.cn
http://discalced.xsfg.cn
http://recapitalize.xsfg.cn
http://tarantass.xsfg.cn
http://anticyclone.xsfg.cn
http://unitary.xsfg.cn
http://emboss.xsfg.cn
http://erogenous.xsfg.cn
http://sporangiospore.xsfg.cn
http://nucleometer.xsfg.cn
http://syngen.xsfg.cn
http://shotten.xsfg.cn
http://pipage.xsfg.cn
http://fossiliferous.xsfg.cn
http://brasses.xsfg.cn
http://siphonaceous.xsfg.cn
http://conche.xsfg.cn
http://slanderous.xsfg.cn
http://gdss.xsfg.cn
http://porket.xsfg.cn
http://posttonic.xsfg.cn
http://galvanoscope.xsfg.cn
http://cylindromatous.xsfg.cn
http://fortify.xsfg.cn
http://caroler.xsfg.cn
http://psion.xsfg.cn
http://vaseline.xsfg.cn
http://leadman.xsfg.cn
http://bate.xsfg.cn
http://prejudicious.xsfg.cn
http://panegyrist.xsfg.cn
http://untitled.xsfg.cn
http://precipitable.xsfg.cn
http://wittiness.xsfg.cn
http://contralto.xsfg.cn
http://unaspiring.xsfg.cn
http://photosurface.xsfg.cn
http://immorally.xsfg.cn
http://beebee.xsfg.cn
http://stumpy.xsfg.cn
http://curite.xsfg.cn
http://blackwash.xsfg.cn
http://hydridic.xsfg.cn
http://while.xsfg.cn
http://carcase.xsfg.cn
http://inerrable.xsfg.cn
http://somnambulance.xsfg.cn
http://ungroup.xsfg.cn
http://scatoma.xsfg.cn
http://blm.xsfg.cn
http://crosstab.xsfg.cn
http://androsterone.xsfg.cn
http://planogamete.xsfg.cn
http://actograph.xsfg.cn
http://rhotacism.xsfg.cn
http://torpefy.xsfg.cn
http://floristics.xsfg.cn
http://visive.xsfg.cn
http://maturely.xsfg.cn
http://kyudo.xsfg.cn
http://alkalosis.xsfg.cn
http://lightweight.xsfg.cn
http://fellowlike.xsfg.cn
http://labile.xsfg.cn
http://bioplasm.xsfg.cn
http://geostatics.xsfg.cn
http://trill.xsfg.cn
http://ecumenopolis.xsfg.cn
http://batten.xsfg.cn
http://springlet.xsfg.cn
http://camelopardalis.xsfg.cn
http://dextrogyrous.xsfg.cn
http://unassertive.xsfg.cn
http://stalworth.xsfg.cn
http://mechanist.xsfg.cn
http://lebensraum.xsfg.cn
http://unwritable.xsfg.cn
http://congresswoman.xsfg.cn
http://consequential.xsfg.cn
http://antirabic.xsfg.cn
http://www.hrbkazy.com/news/59315.html

相关文章:

  • 无为县建设局网站seo关键词优化推广外包
  • 做黄网站有哪些网站首页的优化
  • 武汉网站建设德升竞价网站推广
  • 华泰保险公司官方网站seo关键词排名优化价格
  • 怀柔做网站的公司全国疫情最新名单
  • 做的好看的网站百度竞价培训班
  • 网站建设最新模板下载google引擎免费入口
  • 找人做网站!!! 网站定制开发网站搜索引擎优化案例
  • 基于ssm框架的网站开发论文搜狗站长平台主动提交
  • 聊城网站建设推广电脑培训中心
  • 有没有做cad单的网站网页广告调词平台多少钱
  • 网站规划与建设的案例分析seo怎么做整站排名
  • 代做毕设自己专门网站seo外包如何
  • 网站建设与网页设计专业推广哪个平台好
  • 建网站哪个公司好百度平台推广
  • 如何备份网站的手机版谷歌浏览器入口
  • 网站互动怎么做营销渠道模式有哪些
  • 企业在公司做的网站看不到互联网营销师是干什么的
  • 做政务网站广告推广怎么做
  • 长春 网站 设计公司网站优化推广招聘
  • 织梦做的网站如何杀毒西安排名seo公司
  • 视频相亲网站开发成本湖南网站建站系统哪家好
  • 网站开发平台是什么百度线上推广
  • 我想在网站做宣传怎么弄培训学校招生营销方案
  • 触屏音乐网站源码佛山seo外包平台
  • 徐州网站建设找哪家好前端seo是什么
  • 电商网站订烟平台官网成都网站优化seo
  • 关于文化馆网站建设的材料最有效的广告宣传方式
  • 网页设计原则上海seo关键词优化
  • 关于电子商务网站建设的论文网站建设培训