This is a solution rather than a question. @davness says this is technically a supported feature, but that the custom.yaml file isn’t documented. @alento asked me to post the solution here. However, I’m not sure if this is the correct category or if there should be a new category, as this is a supported feature but isn’t related to e-mail features but to the Custom DNS aspect of MIAB.
Note that this solution is only tested with http (and https). I’m not certain how to use SRV records but they are not necessary for http (and https). Therefore, solution will probably not solve the questions (with unconfirmed answers) at:
- SRV records on mail in a box
- How to setup SRV Records
- Note that the solution there is missing the trailing dot, which is required.
I can’t put the full URLs above because a new forum user can only put 2 URLs, and the system counts the parts in code below apparently.
Comment if anything here helps you or if there are changes necessary to solve those issues. A moderator may want to link them back to here–a few days is a pretty short span before the thread is locked.
In the steps, don’t forget to change the following where noted with asterisks:
* Replace “example.com” in all steps below with the domain under which you want to place the subdomain.
** Replace “service” in all steps below with your subdomain.
*** Replace the port number with the port you are using
- Log in as the MIAB admin.
- Make a /home/user-data/www/custom.yaml such as:
artspatter.example.com: proxies: /: http://localhost:12345
- Note that you must put
http(https will be handled automatically).
- Only if the domain doesn’t have any e-mail addresses yet, add a mailbox or alias such as
- Add a mailbox or alias such as
- Reload the custom configuration: Go to Web, hit any “Change” button, then “Update”.
- Under “System”, click TLS (SSL) Certificates, then click the Provision button.
It seemed to take some number of minutes to take effect, but the “Provision” button may have fixed everything if I hadn’t restarted services manually prior to pushing it. The following unanswered questions remain:
The “Provision” button seems to reload nginx, since https worked right away when everything but https worked prior to pushing it. Does
systemctl reload nginxneed to run at any step?
Anyone who knows answers to those two questions, please comment.
Regardless, the steps above result in a subdomain that points to a service running on a custom port, and both http and https work.