0

How can I redirect a specific URL in nginx to a different URI path?

I'm looking to handle the success of a password reset to redirect to the login page of a different web application on the same subdomain.

E.g (https://subdomain.example.com/webapp/login/login.action#/?passwordUpdate=true -> https://subdomain.example.com/webapp2/).

I've tried the following, but it doesn't seem to hit the location block.

location ~/webapp/login/login.action#/?passwordUpdate=true {
    return 301 https://subdomain.example.com/webapp2/;
}
c4154882
  • 5
  • 2
  • And it never will. The `#` and everything behind it is never sent to the server, it is only handled on the client. – Gerald Schneider May 07 '20 at 12:44
  • Does this answer your question? [Apache redirect to same path but with a # fragment](https://serverfault.com/questions/972910/apache-redirect-to-same-path-but-with-a-fragment) – Gerald Schneider May 07 '20 at 12:45
  • Thanks both, I didn't realise fragments weren't handled at the server side. Good to know! – c4154882 May 07 '20 at 12:56

0 Answers0