I uploaded the production build to the CyberPanel and made some progress.
Changed A record to point to the panel and used the rewrite rules.
A least, not getting the 404 from the original domain anymore, but the default 404 from CyberPanel.