尝试弄清楚如何将静态页面添加到 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/