AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 753924
Accepted
remudada
remudada
Asked: 2016-02-04 22:56:20 +0800 CST2016-02-04 22:56:20 +0800 CST 2016-02-04 22:56:20 +0800 CST

在同一台服务器上运行 Hudson、Sonar 和 HA 代理

  • 772

我在同一台服务器上运行 Hudson、Sonar 和 HA 代理(这样做是为了 POC,因此无法访问多个服务器。

我正在使用 HAProxy 为两台服务器启用 SSL。

我可以使用来自主机的以下 URL 127.0.0.1:9000/sonar 和 127.0.0.1:8088/hudson 在本地访问这些服务器中的每一个

但是当我尝试使用 https:/52.XXX/sonar 或 https:/52.XXX/hudson 远程访问服务器时,我得到了

No data received
ERR_EMPTY_RESPONSE

如果我将 a 添加default_backend sonar到 HAProxy 配置中,我可以运行声纳但不能运行 hudson,反之亦然。

我的 HAProxy 配置是这样的

global
    log 127.0.0.1 local2
    tune.ssl.default-dh-param 2048

defaults
    mode tcp
    # Set timeouts to your needs
    timeout client  1h
    timeout connect 1h
    timeout server  1h
    option http-server-close

frontend http
    mode http
    bind *:80
    compression algo gzip
    redirect scheme https if !{ ssl_fc }

frontend https
    mode tcp
    bind *:443 ssl crt /etc/haproxy/buildserver.pem
    compression algo gzip

    use_backend sonar if { path_beg /sonar }
    use_backend hudson if { path_beg /hudson }

backend sonar
    server srv_sonar localhost:9000

backend hudson
    server srv_hudson localhost:8088

任何有关让声纳/哈德逊运行的帮助将不胜感激。

编辑有效的最终配置文件

global
    log 127.0.0.1 local2
    tune.ssl.default-dh-param 2048

defaults
    mode http
    # Set timeouts to your needs
    timeout client  1h
    timeout connect 1h
    timeout server  1h
    option http-server-close

frontend http
    bind *:80
    compression algo gzip
    redirect scheme https if !{ ssl_fc }

frontend https
    bind *:443 ssl crt /etc/haproxy/buildserver.pem
    compression algo gzip

    use_backend sonar if { path_beg /sonar }
    use_backend hudson if { path_beg /hudson }

backend sonar
    server srv_sonar localhost:9000

backend hudson
    server srv_hudson localhost:8088
ssl
  • 1 1 个回答
  • 498 Views

1 个回答

  • Voted
  1. Best Answer
    GregL
    2016-02-10T06:28:33+08:002016-02-10T06:28:33+08:00

    您的配置已设置为mode tcp用于该frontend https块。

    将其更改为mode http,您应该没问题。

    原因是 HAProxy 不解码您的 HTTP 请求,而只是查看第 4 层信息(源和目标 IP 和端口)。

    • 3

相关问题

  • 如何使用 Tomcat 5.5 更新 SSL 证书

  • 为 IIS6 自行生成 SSL 证书?

  • plesk 上的域和子域 ssl 访问

  • 如何设置 SSL 邮件服务器?

  • 如何通过 SVN 命令行接受 SSL 证书?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve