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

280
Visualizações
Is there some way I get 301 error while proxy_pass is returning 502 error?
location / {
   proxy_pass /newurl/;
}

location /newurl {
   return 303 /old/users;
}

I am trying to access / and getting 502 error, as my proxy to /newurl is returning an error 301. Is there some way I can proxy and get the 301 error with the same content to UI?

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

0

Instead of using proxy_pass take a look at the rewrite directive.

You are receiving the 502 error message because the proxy_pass directive in your snippet is not pointing to a valid URL.

location / {
 rewrite ^ /newurl break;
}
over 4 years ago · Santiago Trujillo Relatório

0

I would suggest share a complete nginx block so we can see what you doing wrong

server {
    . . .
    server_name example.com www.example.com;

    rewrite ^/products.html$ /offer.html permanent;
    rewrite ^/services.html$ /offer.html permanent;
    . . .
}
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