title: 301 Only Part of the URL in Nginx
body: <p>Trying to 301 a url by matching just its post id. For example I just want to rewrite any url that ends in -158436, yet I can't seem to make it work out.</p>
  
  <pre><code>    location /forum/this-stuff-does-not-matter-158436 {
      rewrite ^ http://www.thegoodurl.com/whatever/ permanent;
  }
  </code></pre>