Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

177
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda