linux - 在haproxy中添加静态html页面

标签 linux haproxy

尝试弄清楚如何将静态页面添加到 haproxy。

我有一个网站:https://sky.example.com 我需要添加额外的静态页面 https://sky.example.com/testing通过Haproxy

我的配置文件 haproxy.cfg 如下所示:

global
   log /var/log loca2 err
   chroot /var/lib/haproxy
   user haproxy
   group haproxy
   daemon
   tune.ssl.default-dh-param 1024
   maxconn 8000de here
defaults
   mode http
   log global
   balance static-rr
   option httplog
   timeout server 300s
   timeout client 300s
   timeout connect 5s
   timeout queue 60s
   retries 3
   timeout http-request 60s
   maxconn 8000
frontend skying
   bind *:443 ssl crt /etc/haproxy/ssl/testing.pem
   option forwardfor
   acl modelx hdr(host) -i sky.example.com
   use_backend missmay if modelx
   acl is_info_testing path /testing
   use_backend missmay if is_info_testing
backend missmay
   mode http
   errorfile 200 /etc/haproxy/static/testing.html
   server test1_node1 192.168.1.25:78222 check cookie test1_node1
   server test1_node2 192.168.1.26:78222 check cookie test1_node2

但是它不起作用。当我尝试获取页面 https://sky.example.com/testing 时出现 404 错误

最佳答案

根据你的配置文件很难说到底出了什么问题,但我建议你先检查一下 haproxy 版本。有时不同的版本可能会导致类似的问题。

关于linux - 在haproxy中添加静态html页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69105679/

相关文章:

linux - linux内核模块防止文件系统数量增加

php - 如何安装已安装但缺少依赖项 php-common 的 php-mbstring?

amazon-s3 - HaProxy透明代理到AWS S3静态网站页面

haproxy - 使用 HAProxy 重定向 URL 路径并保留查询字符串

android - android中的shell脚本给出[: not found

linux - 如何验证禁用或停止的 UNIX/Linux 服务是否具有有效的二进制路径?

c - 如何使用sqlite的外键链接三个表1->2->3不同的列

ssl - 用于 HTTP 而非 WebSocket 的 HAProxy SSL 重定向

load-balancing - 使用 HAProxy for Postgresql 9.4 的负载平衡

docker - haproxy SSL 终止后的 Browsersync,无法正常工作