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

301
Visualizações
NGINX Reverseproxy Problem: Publishing a Webapp behind a ReverseProxy

i have a "little" NGinx Problem.

I have Multiple Webapps and i will publish it through the NGINX Reverseproxy.

Under 1 URL i will publish multiple Webapps:

so:

https://Reverseproxy/webappA
https://Reverseproxy/webappB
https://Reverseproxy/webappC

This work so:

https://Reverseproxy/webappA --> redirect to http://www.webappaWebserver.com/webappA

--> And naturally this works fine ;-).

But with my Webapp B i have a challenge. I must find a way to bring the follow Scenario to work:

https://Reverseproxy/webappB --> redirect to http://www.webappBWebserver.com/

--> And this doesn´t work becuse the Subsite (after the Slash) is not there. But i can´t made URL Webserverchanges on this Webserver.

So how i can get this get running with this Constellation?

Here are my Config for the Reverseproxy:

  location /appb {
    proxy_pass              http://10.254.1.41:80;
    include                /etc/nginx/conf.d/proxy.conf;
  }

proxy.conf:

proxy_http_version                 1.1;
proxy_cache_bypass                 $http_upgrade;

### Proxy headers
proxy_set_header Upgrade           $http_upgrade;
proxy_set_header Connection        $connection_upgrade;
proxy_set_header Host              $host;
proxy_set_header X-Real-IP         $remote_addr;
proxy_set_header Forwarded         $proxy_add_forwarded;
proxy_set_header X-Forwarded-For   $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host  $host;
proxy_set_header X-Forwarded-Port  $server_port;

### Proxy timeouts
proxy_connect_timeout              60s;
proxy_send_timeout                 60s;
proxy_read_timeout                 60s;
~

Thank you very much for your help.

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

0

  • Replace page_name with webappA,webappB or webappC .

  • Replace example.com with your subdomain.

      location /page_name/ { 
                      rewrite ^([^.]*[^/])$ $1/ permanent;
                      sub_filter_once off;
                      sub_filter_types *;
                      sub_filter /_elderjs /page_name/_elderjs;
                      proxy_ssl_verify off;
                      proxy_set_header Host "example.com";
                      proxy_set_header X-Forwarded-Host "";
                      proxy_set_header X-Forwarded-For "";
                      proxy_set_header Accept-Encoding "";
                      proxy_set_header Cookie "";
                      proxy_ssl_server_name on;
                      proxy_pass https://example.com/;
                      proxy_redirect ~^(http://[^/]+)(/.*)$ https://$http_host$2;
       }
    

Its works for me ;). Hope this answer solves your problem.

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