Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

176
Views
static content not served properly whenTwo react apps hosted behind HAProxy

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 '<' enter image description here

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

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
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!