Hi everyone, to structure the dashboards I installed metabase on premise on a Linux server in the company infrastructure (so I call Metabase with internal IP) now I should make the system accessible on the web via domain, then configure nginx or apache to make metabase accessible externally. A question for you who are practical, I see that from the metabase settings (site url) where the internal metric is now, at this point I should set it with the domain name of the type: http (or https)://domainname. On metabase on that setting it tells me: "Only change this if you know what you're doing! This URL is used for things like creating links in emails, authentication redirects, and some embedding scenarios, so changing it may break functionality or prevent you from accessing this instance. " I'm terrified that if I do something wrong the instance would be inaccessible, can you tell me the exact steps to follow to avoid irreversible crashes? Thanks so much for your help ![]()
This is complicated. The same Metabase URL has to work everywhere, whether accessed internally or externally. There’s a couple of common ways to solve this.
- Split horizon DNS – There are 2 sets of DNS servers (or 2 views in the DNS server), one that serves internal clients and one that serves external clients (the Internet). Your zone is modified so that the internal server serves internal IP addresses and the external one serves external IP addresses. That way, ‘metabase.example.com’ goes to the right place no matter where you sit.
- Firewall hairpinning – Your Metabase server is reachable from an external address, and if internal people try to access it, the firewall understands how to translate addresses so this works. Not all firewalls support this.
As far as safely changing the setting, there’s 3 ways to attack this.
- The URL can be set using the environment variable
MB_SITE_URL. You have to restart Metabase for changes to take effect. Using this will prevent you from changing the value in Admin, though; if you forget to set the environment variable, then the old value will take effect. This is easier in hosted environments where you can easily control environment variables. - Use a config file to alter the
site-urlvalue. You have to restart Metabase for changes to take effect. You retain the ability to change the value in Admin, though if the config file setting is still present then it will re-set it back to the config file value. - Back up the app database and test the change, if it doesn’t work then restore the app db. This may work better if your database supports snapshots and there is no one using your Metabase instance while you are changing the setting. This preserves the ability to change the value in Admin.
Thanks for the information provided, I will backup the virtual machine before making the URL changes. So you recommend changing the value from the variable instead of the admin panel, if I understand correctly.
Yes, from personal experience.