问题
I know that I can customize domain name for firebase hosting. But how can I customize the firebase database, auth and storage domain name? eg.
authDomain: example.firebaseapp.com => auth.example.com
databaseURL: example.firebaseio.com => db.example.com
storageBucket: example.appspot.com => storage.example.com
I tried to cname the domain (eg cname auth.example.com to example.firebaseapp.com) but this cause the https://auth.example.com shows the certificate error. can I resolve that?
回答1:
Firebase doesn't offer the ability to whitelabel our services under your own domain.
You could choose to proxy all traffic through Hosting + Cloud Functions, but that would be a significant amount of additional work.
What is the need to offer your own custom domain on these services?
回答2:
Did you also change the firebase script snippet in your code?
<script src="https://www.gstatic.com/firebasejs/4.4.0/firebase.js"></script>
<script>
// Initialize Firebase
var config = {
apiKey: "yourkey",
authDomain: "auth.example.com",
databaseURL: "https://db.example.com",
projectId: "yourid",
storageBucket: "storage.example.com",
messagingSenderId: "id"
};
firebase.initializeApp(config);
</script>
来源:https://stackoverflow.com/questions/46484106/how-to-customize-domain-name-of-firebase-database-auth-and-storage