Hoe kan ik dynamische redirects gebruiken?

For anyone else landing here, I implemented this by SSHing into my server, navigating to /var/discourse, opening containers/app.yml with vim and scrolling down to the hooks section. I then added this bit:

hooks: # this line should already be there
  after_ssl:
    - replace:
        filename: "/etc/nginx/conf.d/discourse.conf"
        from: "location @discourse {"
        to: |
          location /discussion/ {
            return 301 https://vanilla.29th.org$request_uri;
          }

          location @discourse {
  after_code: # this line should already be there