大网数据广告活动
服务器运维问答

Use HAProxy as https forward proxy and ssl termination

· 52CE 我爱测

I'm trying to do something like this: Clients send HTTP request to HAProxy. HAProxy does the TLS stuff to convert the request into https and forward to a server. HTTP to the client. The server sends https response to HAProxy, the…

问题原文

原帖链接 · Minh Duc Truong · CC BY-SA 4.0

I'm trying to do something like this:

  • Clients send HTTP request to HAProxy.
  • HAProxy does the TLS stuff to convert the request into https and forward to a server. HTTP to the client.
  • The server sends https response to HAProxy, then the response is forwarded as HTTP to client.

Currently, I'm not so sure how to achieve that goal with HAProxy. I tried to create a frontend listen on a custom port and then forward to a backend server. This is my HAProxy configuration:

frontend manager_https
    bind *:8443
    mode tcp
    log global
    maxconn 2000
    timeout client 50000
    default_backend     https_be

backend https_be
    timeout connect         5000
    timeout server          50000
    retries                 3
    server                  rtmp-manager 127.0.0.1:12345 check-ssl verify none

Unfortunately, this does not work. When clients send HTTP request, HAProxy also forward the HTTP request to backend server, not HTTPS. How can I change the configuration to make it works as expected?

Another question: Is there any ways to make the offload transparent with client using HAProxy?

I would really appreciate any help!

已采纳解答

原帖链接 · Lacek · CC BY-SA 4.0

Specify the ssl directive in the definition of your backend server, like this:

 server                  rtmp-manager 127.0.0.1:12345 check-ssl ssl verify none

Note that the check-ssl option affects the health checks only, and if ssl is specified, it can be omitted, since health checks are automatically done via SSL.

HAProxy should act as a transparent reverse proxy, so clients should not recognize that the requests are in fact handled by backend servers.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2019-01-21)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。