Same server hosts 2 react apps onports 300 and 4007 I would like to forward the client request to the profile app through the following haproxy config.
frontend http_front
bind *:80
acl has_special_uri path_beg /profile
use_backend manfrontend if has_special_uri
stats uri /haproxy?stats
default_backend http_rear
backend http_rear
balance roundrobin
server wbs1.com 10.154.22.33:3000 check
backend manfrontend
balance roundrobin
server webC 10.154.22.33:4007 check
The issue is that the application does not render properly after the forwarding.(ie when the user clicks http://10.154.22.33/profile)
The weird thing is that the static content is retrieved from the default backend. What I expect is it should try to render static pages from manfrontend in haproxy config
When haproxy is disabled it runs without any problems.
Any help is deeply appreciated.
The error messages are as follows.
Uncaught SyntaxError: Unexpected token '<'

Implementing a rule based on referer header made the trick for me. Similar application behind a proxy caused content to be served from different applications.
frontend http_front
bind *:80
mode http
acl profile_uri path_dir -i /management/profile
acl mfe_referer hdr_dir(referer) -i /management/profile
use_backend man if profile_uri
use_backend man if mfe_referer
default_backend med
backend man
server MAN x.x.x.x
backend med
server MEDIA y.y.y.y