linux - 在haproxy中添加一个静态html页面
问题描述
试图弄清楚如何将静态页面添加到 haproxy。
我有一个网站:https ://sky.example.com 我需要通过 Haproxy 添加静态页面https://sky.example.com/testing
我的配置文件 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 版本。有时不同的版本可能会导致这样的问题。
推荐阅读
- azure - ModuleClient 直接方法连接停止工作
- haskell - Haskell 列表函数
- wordpress - 在 WordPress.org 上,下载次数是如何工作的?
- kotlin - 如何在 Kotlin 中扩展枚举?
- gmail - 如何使用 JavaMailSender 使用 gmail 的“机密模式”
- python - 如何读取多个excel文件并加载到一张excel表中
- java - 将视图与现有视频合并
- linux - 将文件中的一列复制为另一个文件中的第一列
- javascript - 单击按钮时启动文本动画,如果再次单击按钮,则清除并再次启动动画
- sapui5 - 如何使用 SAP UI5 生成 OTP 和验证?