Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Metabase to work on sub paths #30895

Open
paoliniluis opened this issue May 20, 2023 · 7 comments
Open

Allow Metabase to work on sub paths #30895

paoliniluis opened this issue May 20, 2023 · 7 comments

Comments

@paoliniluis
Copy link
Contributor

Is your feature request related to a problem? Please describe.
Right now Metabase expects to be running in the root path of the server and that brings us some problems when users set it up on a sub path. Right now it acts really weird if you just expose the server in a sub path without doing any kind of redirection.

Describe the solution you'd like
We should parse the MB_SITE_URL and see if it's running on a sub-path to make it work correctly with this pattern

Describe alternatives you've considered
An more-than-needed complicated nginx config

How important is this feature to you?
Important for customers that need to host Metabase in sub-paths

Additional context
NA

@ahnaf-tahmid-chowdhury
Copy link

ahnaf-tahmid-chowdhury commented Sep 22, 2023

I have configured Like this but getting blank page

metabase

MB_SITE_URL="/metabase/"

nginx

server {
    listen 443 ssl default_server;
    listen [::]:443 ssl default_server;
    ssl_certificate my crt;
    ssl_certificate_key my key;
    client_max_body_size 10M;
    server_name _;


    location / {
	here is my django server
    }

    location /metabase/ {
	proxy_pass http://localhost:3000;

    }
}

@paoliniluis
Copy link
Contributor Author

It’s not a valid site url

@ahnaf-tahmid-chowdhury
Copy link

ahnaf-tahmid-chowdhury commented Sep 22, 2023

It’s not a valid site url

Hi @paoliniluis, thank you. I tried using the complete site URL, but it didn't work out.

MB_SITE_URL="https://nrms.mist.ac.bd/metabase/"

The site is now closed.

@paoliniluis
Copy link
Contributor Author

Check the console, you might see the error there. Btw: you should post this on the forums

@Shalashtein
Copy link

I have the same issue, I looked through the forums and the questions around this issue are stale

@ahnaf-tahmid-chowdhury
Copy link

I have the same issue, I looked through the forums and the questions around this issue are stale

I am using nginx to fix this for now

    location /metabase/ {
        proxy_pass http://localhost:3000/; 
        proxy_set_header   X-Real-IP $remote_addr;
        proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;  
        proxy_set_header   Host $host;
        proxy_set_header   X-Forwarded-Host $host;
        proxy_redirect     ~^/(.*)$ /metabase/$1; 
    }

@setop
Copy link

setop commented May 5, 2024

does not work form me neither with last version v0.49.8 behind treafik.

a bit of a shame as it is a pretty common production setup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants