首页 > 其他分享 >Jetty的http-forwarded模块

Jetty的http-forwarded模块

时间:2024-03-10 19:22:45浏览次数:44  
标签:HTTP Forwarded ## Jetty jetty httpConfig http forwarded

启用http-forwarded模块,执行如下命令:

java -jar $JETTY_HOME/start.jar --add-modules=http-forwarded

命令的输出,如下:

INFO  : http-forwarded  initialized in ${jetty.base}/start.d/http-forwarded.ini
INFO  : Base directory was modified

http-forwarded模块的配置文件$JETTY_BASE/start.d/http-forwarded.ini,内容如下:

# ---------------------------------------
# Module: http-forwarded
# Enables processing of the "Forwarded" HTTP header (and its predecessors "X-Forwarded-*" HTTP headers).
# The "Forwarded" HTTP header is added by intermediaries to provide information about the clients.
# ---------------------------------------
--modules=http-forwarded

### ForwardedRequestCustomizer Configuration

## Whether to process only the RFC7239 "Forwarded" header.
## "X-Forwarded-*" headers are not processed.
# jetty.httpConfig.forwardedOnly=false

## Whether the address obtained from "Forwarded: by=" or
## "X-Forwarded-Server" is used in the request authority.
# jetty.httpConfig.forwardedProxyAsAuthority=false

## Whether the "X-Forwarded-Port" header is used in the request authority,
## or else it is the remote client port.
# jetty.httpConfig.forwardedPortAsAuthority=true

## The name of the RFC 7239 HTTP header.
# jetty.httpConfig.forwardedHeader=Forwarded

## The name of the obsolete forwarded host HTTP header.
# jetty.httpConfig.forwardedHostHeader=X-Forwarded-Host

## The name of the obsolete forwarded server HTTP header.
# jetty.httpConfig.forwardedServerHeader=X-Forwarded-Server

## The name of the obsolete forwarded scheme HTTP header.
# jetty.httpConfig.forwardedProtoHeader=X-Forwarded-Proto

## The name of the obsolete forwarded for HTTP header.
# jetty.httpConfig.forwardedForHeader=X-Forwarded-For

## The name of the obsolete forwarded port HTTP header.
# jetty.httpConfig.forwardedPortHeader=X-Forwarded-Port

## The name of the obsolete forwarded https HTTP header.
# jetty.httpConfig.forwardedHttpsHeader=X-Proxied-Https

## The name of the obsolete forwarded SSL session ID HTTP header.
# jetty.httpConfig.forwardedSslSessionIdHeader=Proxy-ssl-id

## The name of the obsolete forwarded SSL cipher HTTP header.
# jetty.httpConfig.forwardedCipherSuiteHeader=Proxy-auth-cert

各参数的说明,如下:

  • jetty.httpConfig.forwardedOnly
    是否仅处理标准的转发头部,跳过对非标扩展比如HTTP头部X-Forwarded-*的处理。
    默认值为false,即兼容非标HTTP头部X-Forwarded-*
    转发场景下的标准HTTP头部,可参考RFC文档Forwarded HTTP Extension
  • jetty.httpConfig.forwardedProxyAsAuthority
    从请求头部X-Forwarded-Server或者Forwarded: by=中得到的主机信息,是否参与认证。默认值为false
  • jetty.httpConfig.forwardedPortAsAuthority
    从请求头部X-Forwarded-Port获取到的端口信息,是否参与认证。默认值为true
  • jetty.httpConfig.forwardedHeader
    RFC文档Forwarded HTTP Extension中定义的转发头部,取值为Forwarded
  • jetty.httpConfig.forwardedHostHeader
    转发场景下的非标HTTP头部,取值为X-Forwarded-Host
  • jetty.httpConfig.forwardedServerHeader
    转发场景下的非标HTTP头部,取值为X-Forwarded-Server
  • jetty.httpConfig.forwardedProtoHeader
    转发场景下的非标HTTP头部,取值为X-Forwarded-Proto
  • jetty.httpConfig.forwardedForHeader
    转发场景下的非标HTTP头部,取值为X-Forwarded-For
  • jetty.httpConfig.forwardedPortHeader
    转发场景下的非标HTTP头部,取值为X-Forwarded-Port
  • jetty.httpConfig.forwardedHttpsHeader
    转发场景下的非标HTTP头部,默认值为X-Proxied-Https
  • jetty.httpConfig.forwardedSslSessionIdHeader
    默认值为Proxy-ssl-id
    参考代理和路由选择 URL中关于Client SSL Session ID Forwarding的说明,如下:

    默认 HTTP 标头称为 Proxy-ssl-id,但可以使用您选择的任何标头发送客户机的 SSL/TLS 会话 ID。

  • jetty.httpConfig.forwardedCipherSuiteHeader
    默认值为Proxy-auth-cert
    参考代理和路由选择 URL中关于Client SSL/TLS Certificate Forwarding的说明,如下:

    默认 HTTP 标头称为 Proxy-auth-cert,但可以使用您选择的任何标头发送客户机的 SSL/TLS 证书。

参考资料

标签:HTTP,Forwarded,##,Jetty,jetty,httpConfig,http,forwarded
From: https://www.cnblogs.com/jackieathome/p/18064608

相关文章

  • Jetty的http2模块
    启用http2模块,执行如下命令:java-jar$JETTY_HOME/start.jar--add-modules=http2命令的输出,如下:INFO:http2initializedin${jetty.base}/start.d/http2.iniINFO:Basedirectorywasmodifiedhttp2模块的配置文件$JETTY_BASE/start.d/http2.ini,内容如下:......
  • HttpClientHandler VS SocketsHttpHandler
    .NETFramework和.NETCore2.0及更低版本中由HttpClient使用的默认消息处理程序为HttpClientHandler。从.NETCore2.1开始,类SocketsHttpHandler提供了更高级别的HTTP网络类(例如HttpClient)使用的实现。使用SocketsHttpHandler提供了许多优点:与之前的实施相比,性能......
  • Jetty的http3模块
    启用http3模块,执行如下命令:java-jar$JETTY_HOME/start.jar--add-modules=http3命令的输出,如下:ALERT:Thereareenabledmodule(s)withlicenses.Thefollowing2module(s):+containssoftwarenotprovidedbytheEclipseFoundation!+containssoftwarenotco......
  • Jetty的server模块
    启用server模块,执行如下命令:java-jar$JETTY_HOME/start.jar--add-modules=server命令的输出,如下:INFO:serverinitializedin${jetty.base}/start.d/server.iniINFO:Basedirectorywasmodified查看server模块的配置文件,执行如下命令:cat$JETTY_BASE/s......
  • HTTPS证书生成和配置
    HTTPS证书生成和配置1:创建服务器私钥opensslgenrsa-des3-outserver.key2048输入密码:password2:创建签名请求的证书(CSR)opensslreq-new-keyserver.key-outserver.csr3:加载SSL支持的Nginx并使用私钥时去除口令cpserver.keyserver.key.bakopensslrsa-inse......
  • 【Python使用】python高级进阶知识md总结第2篇:HTTP 请求报文,HTTP响应报文【附代码文
    python高级进阶全知识知识笔记总结完整教程(附代码资料)主要内容讲述:操作系统,虚拟机软件,Ubuntu操作系统,Linux内核及发行版,查看目录命令,切换目录命令,绝对路径和相对路径,创建、删除文件及目录命令,复制、移动文件及目录命令,终端命令格式的组成,查看命令帮助。HTTP请求报文,HTTP响应报文......
  • Jetty的ssl模块
    启用ssl模块,执行如下命令:java-jar$JETTY_HOME/start.jar--add-modules=ssl命令的输出,如下:INFO:sslinitializedin${jetty.base}/start.d/ssl.iniINFO:Basedirectorywasmodified查看ssl模块的配置文件,执行如下命令:cat$JETTY_BASE/start.d/ssl.i......
  • Jetty的bytebufferpool模块
    bytebufferpool模块用于配置Jetty的ByteBuffer对象的对象池。通过对象池的方式来管理ByteBuffer对象的使用和生命周期,期望降低Jetty进程内存的使用,同时降低JVM运行期垃圾回收操作的压力。启用bytebufferpool模块,执行如下命令:java-jar$JETTY_HOME/start.jar--add-modules=byt......
  • Jetty的console-capture模块
    console-capture模块用于记录Jetty运行时向标准输出和标准错误写出的信息。Java的标准输出流,即System.out。Java的标准错误流,即System.err。console-capture模块支持在每天晚上切换输出文件,自动清理超出保留期的日志文件。启用console-capture模块,执行如下命令:java-jar$JET......
  • Data encapsulation of HTTP, TLS, TCP and IP
    数据包封装过程 原文:TLSrecordsizehasanimportantimpactontheperformanceofHTTPS.Herewediscusstheeffectofrecordsizeondataencapsulation,asshowninFigure2.TCPisabyte-streamprotocol,whichcansplitmessagefromtheupperlayerofT......