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

234
Visualizações
How to reverse proxy app in a subdirectory?

I'd like to reverse proxy my application under server.com/myapp/homem where server.com/myapp is the proxied address and /home is an URL handled by my app.

What is the best / recommended solution to do that so that the app will generate proper paths<img src="/myapp/static/...">

Which of the two following approaches I should take: 1. X-Forwarded-Path: I proxy GET Path=/home and add an X-Forwarded-Path: /myapp 2. Base_url set in config: I proxy GET Path=/myapp/home and set base_url = server.com/myapp

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

The nginx rewrite directive can handle what you are looking for

You server block should look similar to the following snippet

server {
    listen 80;

    rewrite ^/myapp/(.*)$ /$1 last;

    location /home {
        proxy_set_header X-Forwarded-Path myapp;
        proxy_pass http://1.2.3.4;
    }
}

Take a look at either of the following for more information

  • https://www.nginx.com/blog/creating-nginx-rewrite-rules/
  • http://nginx.org/en/docs/http/ngx_http_rewrite_module.html
over 4 years ago · Santiago Trujillo 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