简体   繁体   English

通过代理将 HTTP/1 转换为 HTTP/2

[英]HTTP/1 to HTTP/2 translation via proxy

I have a legacy client application that supports HTTP/1 protocol only.我有一个仅支持 HTTP/1 协议的旧客户端应用程序。

Some of the servers accessed by this application no longer support the HTTP/1 protocol because they migrated to the HTTP/2 protocol.此应用程序访问的某些服务器不再支持 HTTP/1 协议,因为它们迁移到了 HTTP/2 协议。

Is it possible to translate the requests made from a client HTTP/1 to a server HTTP/2 using a proxy application such as NGINX?是否可以使用代理应用程序(例如 NGINX)将客户端 HTTP/1 发出的请求转换为服务器 HTTP/2?

Yes, it is possible.对的,这是可能的。 I'm sure it's possible to use NGNIX.我确信可以使用 NGNIX。 I also have successfully used H2O ).我也成功地使用了H2O )。 You would use a configuration file (assuming your legacy app listens on port :8080):您将使用一个配置文件(假设您的旧应用在端口 :8080 上侦听):

access-log: /dev/stdout
listen: 80
listen:
  port: 443
  ssl:
    certificate-file: server.crt
    key-file: server.key
hosts:
  "*":
    paths:
      /:
        proxy.reverse.url: http://127.0.0.1:8080

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM