12

I have a custom domain setup in firebase hosting that works fine. When I create a preview channel though it always creates it at the default "web.app" domain. I tried just replacing "web.app" in the preview channel url with my custom domain but got a site not found error. Does anyone know if it's currently possible to deploy a preview channel to a custom domain configured in firebase hosting?

Example: The preview channel is: https://project-id--channel-name-8rdxche4.web.app, and I want it to be https://project-id--channel-name-8rdxche4.my.domain

This is because my frontend project is hosted in Firebase, but my backend is on my own server that is also under my custom domain. So for cookies to be set properly I need the preview channel to be hosted from the custom domain too.

Alex Egli
  • 1,884
  • 2
  • 24
  • 43

1 Answers1

4

It is not possible at the moment and I don't think it will be possible in the future, as Firebase would need to connect to the APIs from your domain provider to create temporal subdomains.

David Miguel
  • 12,154
  • 3
  • 66
  • 68
  • But why not allow to create this statically? i.e. the user will configure that subdomain and stick it to a particular preview channel, the same way the live channel is sticked to a custom domain. – EliuX Oct 19 '22 at 19:39
  • Technically, this is possible with a wildcard DNS entry. For easy of use, it should probably be combined with a wildcard HTTPS certificate, but that may have some security implications. It would be very nice to host previews on e.g. https://project-id--channel-name-8rdxche4.preview.example.com/ – Øyvind Matheson Wergeland Nov 30 '22 at 09:07