Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

168
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda