Migrate a XenForo forum to Discourse

I tried a rewrite to make the links of xenforo not unusable, here is the result.

To write a permanent rewrite i used the following help: Set up Let’s Encrypt with multiple domains / redirects as well as that of @pfaffman

hooks:

...

  after_ssl:
    - replace:
        filename: "/etc/nginx/conf.d/discourse.conf"
        from: /#\s*auth_basic_user_file\s*.*;/
        to: |
          # auth_basic_user_file /etc/nginx/htpasswd;

          location /threads/ {
            rewrite ^/threads/(.*)\.\d+/?$ /t/$1 permanent;
          }