Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

278
Views
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 answers
Answer question

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 Report

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!