HAProxy and DS Photo


I’m having issues using HAProxy with my Synology’s DS Photo App. I’ve got the following in my confg:

maxconn 256
log local0

mode http
timeout connect 5000ms
timeout client 50000ms
timeout server 50000ms
log global
option httplog

frontend http-in
bind *:80
bind *:443 ssl crt /etc/ssl/domain.com/myexample1.com.pem crt /etc/ssl/myexample2.co/myexample2.co.pem

# Http to https redirect
redirect scheme https code 301 if !{ ssl_fc }

# Pass client IP address
option forwardfor header X-Real-IP
http-request set-header X-Real-IP %[src]

# Define hosts
acl host_photo2 hdr(host) -i photo.myexample2.co

# Figure out which one to use
use_backend photo2_server if host_photo2

backend photo2_server
server NAS2

from a browser everything works fine. from the app on my phone i get a error. [12/Apr/2021:11:24:00.328] http-in~ http-in/<NOSRV> -1/-1/-1/-1/0 503 222 - - SC-- 2/2/0/0/0 0/0 "GET / HTTP/1.1"

i’ve got other servers in my config I didn’t list. Is there a way to get HAProxy to send traffic to a specific backend if it doens’t match anything else?

default_backend sounds like the thing u want.

I got this to work by matching on the path:

use_backend photo2_server if { path -i -m beg /photo/ }

Specify the backend to use when no “use_backend” rule has been matched.

So that’s what u want :slight_smile: . If none of your statements is true, the frontend can fallback to it’s default_backend.

default_backend <backend_name>