Getting Redirects to work correctly

So I am struggling with redirects, as it seems to be common in the forum, I have the following setup:

  • A domain with "A" records for both the naked domain and "www" pointed at the public IP of my server
  • A working letsencrypt acme setup that works for other containers called "letsencrypt-server1" (for example)
  • A working Trafik proxy and docker setup.

What I am trying to achieve is to have:
https://mydomain.tld
http://mydomain.tld
https://www.mydomain.tld
http://mydomain.tld

All directed to the encrypted version of the domain with the www.

What is the proper way of setting this up in a production environment?

Also since this is a pretty standard thing to do, should this be added to the documentation as an example?

Any help on this would be helpful