试图弄清楚如何将静态页面添加到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的版本。有时候不同的版本会导致这样的问题。