1
I'm using Haproxy in my VPS for stream some video content. with my current setup I need to mention each every domain in the front-end and back-end section in my Haproxy.conf file. if I need to watch 10 channels I need to add many domains. I only use this proxy for certain streaming site not for all the web traffic. I installed Dnsmasq on my openwrt router and I can point only necessary domains to my VPS. I need to add entry only for dnsmasq and I need Haproxy to proxy all the things dnsmasq throw it. can I configure something like wildcards in Haproxy configuration? or is there any other methods
My haproxy.conf like this
# Frontend for connections over port 80/http
frontend f_sni_catchall
mode http
bind 0.0.0.0:80
log global
option httplog
option accept-invalid-http-request
capture request header Host len 50
capture request header User-Agent len 150
use_backend b_sni_catchall if { hdr(host) -i www.example.com }
default_backend b_deadend
# Backend for handling connections over port 80/http
backend b_sni_catchall
log global
mode http
option httplog
option http-server-close
server www.example.com www.example.com:80 check inter 10s fastinter 2s downinter 2s fall 1800
instead of using www.example.com I need to use something like this with the wild card
use_backend b_sni_catchall if { hdr(host) -i *.com }
server*e.com *.com:80 check inter 10s fastinter 2s downinter 2s fall 1800
Using full domains in the config file is not possible due to DNS resolving issue. Haproxy wont start with some domain names. Other than that I need to set DNS pointing using dnsmasq or Bind. for do that I need haproxy to configured as forward all the domains what it get from the user
Please post the relevant block from you haproxy config and haproxy version. – Jim G. – 2017-05-24T19:12:12.757
@JimG. please check I updated my question with the Haproxy conf file – gripenfighter – 2017-05-26T03:03:04.893