title: How to redirect a specific path to the same path without www in nginx
body: <p>I've encountered an issue during server configuration: I require a 301 redirect from <a href="http://www.example.com" rel="nofollow">http://www.example.com</a> to <a href="http://example.com" rel="nofollow">http://example.com</a> just for one specific url alias - like /partners.</p>
  
  <p>the expected output-  http:// www.example.com/partners/stuff -> http:// example.com/partners/stuff.</p>
  
  <p>I've tried adding the following code to the vhosts already:</p>
  
  <pre><code>server { 
          server_name http://www.example.com/partners; 
          return 301 $scheme://example.com/partners;
  }
  </code></pre>
  
  <p>but vhosts gives me an error telling me this code isn't valid.<br>
  What's the correct way of implementing such rewrite?</p>