When I’m doing is_root for websocket it’s always give me 404 when I access url (e.g. wss://example.com) , if I remove is_root from use_backend websocket if I can access to websocket from any path (e.g. wss://example.com/afaw will work), but I need only to listen for root (e.g. wss://example.com How I can resolve this?
frontend haproxy443
bind *:443 ssl crt /home/ubuntu/ping-fuji.pem
http-request add-header X-Forwarded-Proto https if { ssl_fc }
acl is_websocket hdr(Upgrade) -i WebSocket
acl is_websocket hdr_beg(Host) -i wss
# acl is_websocket path -i /test
acl is_root path -i /
acl is_url url -i yan.ping-fuji.com
# acl is_websocket hdr_end(Host) -i .com
http-request set-path /hello/ImageServlet if !is_websocket is_root
http-request set-path /v3/channel_1?api_key=oCdCMcMPQpbvNjUIzqtvF1d2X2okWpDQj4AwARJuAgtjhzKxVEjQU6IdCjwm¬ify_self if is_websocket
use_backend websocket if is_websocket is_root
default_backend tomcat