By default Metabase instance is running on Port 80 (HTTP). If you want to access Metabase UI via HTTPS (port 443) then this section describes how to enable HTTPS for Metabase Data Visualization and BI Platform VM solution.
sudo apt update
sudo apt install nginx
sudo cp /etc/nginx/sites-available/default /etc/nginx/sites-available/default_bkup
sudo vi /etc/nginx/sites-available/default
server {
# SSL configuration
#
listen 443 ssl default_server;
listen [::]:443 ssl default_server;
include snippets/snakeoil.conf;
#root /var/www/html;
# Add index.php to the list if you are using PHP
index index.html index.htm index.nginx-debian.html;
server_name _;
location / {
proxy_pass http://127.0.0.1:80/;
proxy_set_header Host $host;
proxy_http_version 1.1;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_buffering off;
proxy_request_buffering off;
# In case of websockets
proxy_set_header Upgrade $http_upgrade;
#proxy_set_header Connection "upgrade";
}
}
To add a firewall rule on Azure, from VM’s details page, select Networking -> Network settings from left pane. Under Rules sections, click on Create Port Rule. Select Inbound port rule, on this page keep all the default settings and select HTTPS under Service dropdown. Save the changes.
For GCP: Open the VM page from GCP console, click on edit and select “https” option and save as shown below:
sudo init 6
Browser will show you an SSL warning, click on the left bottom advance button and then click on Accept the risk and continue. It will take you to the Metabase Login page.
Note: The browser warning is due to a self signed SSL certificate. To eliminate the SSL warning associated with self-signed certificates, you need to obtain a certificate from a trusted CA like Let’s Encrypt. After obtaining the certificate and key, you should back up the existing self-signed certificate files and replace them with the new ones. Finally, restart your web server to apply for the new certificate.
Note: If you encounter 502 Bad Gateway error, then please wait for few seconds and referesh the page.