title: NGINX Redirect all paths to a specific path
body: <p>I have a main domain (<code>example.com</code>) and multiple domains (<code>example.net</code>, <code>example1.info</code>, <code>example2.info</code>) pointing to one location in NGINX configuration like so:</p>
  
  <pre><code>server {
      server_name example.com *.com *.net *.info;
      root /home/example.com/public;
  }
  </code></pre>
  
  <p>And I want to redirect a specific path <code>/login</code> to <code>example.com/login</code>, how do I accomplish it? If I do</p>
  
  <pre><code>server {
      server_name example.com *.com *.net *.info;
      root /home/example.com/public;
  
      location = /login {
      return 301 https://example.com/login;
  }
  </code></pre>
  
  <p>this work for all domains, except <code>example.com/login</code> because it keeps redirecting to itself. </p>
  
  <p>What is the correct way of creating a redirections from a specific path on all sites to my chosen path?</p>