Background: My client is using a proxy server to point to the production environment of the project. So for example their deployment is at https://messyurl.com, but their proxy server is routed to display at https://niceurl.com.
What I did: I set the siteUrl config field to https://niceurl.com, which successfully rendered niceurl.com links throughout all the templates. Cool. But when going to niceurl.com/admin, it redirects me to messyurl.com/admin. I thought I could solve it by adding the baseCpUrl config variable to be set to https://niceurl.com, but that made it so that I got a 404 when visiting https://niceurl.com/admin.
Any ideas why my cp is refusing to cooperate here? The client actually doesn't mind that the CP is at messyurl.com, but the thing they don't like is the entry preview is broken because of cross-domain stuff due to the url conflict.