Best way to redirect mysite.com to forums.mysite.com/landing?

AI-generated summary

The user 45thj5ej wants to redirect mysite.com to forums.mysite.com/landing. Lilly shared a link to a tutorial on redirecting additional domains to a Discourse instance.

45thj5ej is considering moving the forums to the base domain name, replacing forums.mysite.com with mysite.com. They already have an A record pointing to the VPS IP and are looking to forward the base domain URL to that IP or keep it as forums.mysite.com.

A possible solution involves creating a server block in the Nginx configuration file to redirect mysite.me to forums.mysite.me/landing using a 301 redirect. The block would listen on port 80, return a permanent redirect to the specified URL, and append the request URI to the redirect URL.

Not sure if proper category, but I need some help/support with this.

So, I self-host my forums on a VPS. I have my own domain name. I use an A record already so that forums.mysite.com points to my VPS’ IP. The forums page I want to use is forums.mysite.com/landing so I would like when people visit mysite.com it will just take them to the forums page I want automatically as quick as possible.

What is the best approach here? Wasn’t sure if I should do some DNS stuff with A or CNAME records, somehow maybe move forums.mysite.com/landing to just somehow be mysite.com now, etc.

@Lilly Would it be possible to move the forums entirely to the base domain name? So that mysite.com would just be the forums?

Also, I already have an A record that points to my VPS’ IP, where the forums are hosted. So do I now forward my base domain’s URL to that IP or keep it as forums.mysite.com? I’d mostly likely just CNAME my mysite.com to the A record of forums.mysite.com, right?

Is this correctly done? I want to forward mysite.me to forums.mysite.me/landing

  after_web_config:
    - replace:
        filename: /etc/nginx/nginx.conf
        from: /sendfile.+on;/
        to: |
          server_names_hash_bucket_size 64;
          sendfile on;
    - file:
        path: /etc/nginx/conf.d/forumsredirect.conf
        contents: |
          server {
            listen 80;
            server_name mysite.me;
            return 301 $scheme://forums.mysite.me/landing$request_uri;
          }