Based on the comments, I am assuming you have at least the following setup:
- Base stack - includes 22222 and html
- One domain installed with LE for ssl. So, https://domain.tld works.
When you have this setup, the https://###.###.###.###:22222 inherits the ssl cert from the domain.tld. This will cause you to receive an invalid cert when you use an IP address to access the dashboard. The cert is for domain.tld and not for the IP.
This is not a problem as you can access the dashboard from the domain as https://domain.tld:22222.
Unless you use Cloudflare. Cloudflare blocks port 22222. Cloudflare only supports the following web ports: 80, 443, 2052, 2053, 2082, 2083, 2086, 2087, 2095, 2096, 8080, 8443, and 8880. https://blog.cloudflare.com/cloudflare-now-supporting-more-ports/.
To use the dashboard with your first domain using Cloudflare, you will need to change the port from 22222 to one of the acceptable ports listed above. WordOps makes this really easy. See the secure command on: https://docs.wordops.net/commands/secure/
The command to use is:
wo secure --port ####
Works great. Just remember to open up any firewalls you have with the new port number.