HAProxy and DS Photo

Hello,

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

global
daemon
maxconn 256
log 192.170.10.13:514 local0

defaults
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 192.168.10.7:80

from a browser everything works fine. from the app on my phone i get a error.

174.192.82.201:5900 [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/ }

default_backend:
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>