Nginx proxy reverse

hello

I'm trying to use nginx as a reverse proxy on a Debian server to deliver some dash files with friendly links. But when I use proxy pass, nothing happens. When I use 302 as a direct redirect to the browser, the dash opens normally. Browser inspector shows several .js and .css errors.

I only need this to finalize my BI infrastructure. I need your help. Thanks

I run Metabase through nginx here with no issues. Here’s my proxy block (note: I’m using IPv6 localhost, you may need to use 127.0.0.1 instead):

        location / {
            proxy_pass http://[::1]:3000;
            proxy_read_timeout 20m;
            proxy_http_version 1.1;
            client_max_body_size 100M;
        }

None of the errors in your screenshot are fatal. I get the same CSP error on my install (0.56.13.4) and it doesn’t seem to impact anything.

Check the nginx error log and the Metabase log for any errors.

When you say “nothing happens,” you’re getting a blank page? If you View Source of the blank page, is it actually blank?

Make sure the setting for “Site url” is set correctly in Admin, or set by environment variable. (Looks like you need to set it to “http://shm.bi/”.) Metabase needs to be able to generate self-referencing URLs.

(Also, get a Let’s Encrypt certificate and set up HTTPS, no reason to force things to plain HTTP in this day and age. Certbot will do everything for you.)

Thanks for your reply. This is how my nginx server is configured:

server {
listen 80;
server_name shm.bi;

location /faturamento {

    proxy_pass http://127.0.0.1:3000/public/dashboard/xyz123abc;

    proxy_set_header Host $host;
    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;
}

location ~* /(api|app|static|fonts|images|public)/ {
    proxy_pass http://127.0.0.1:3000;
    proxy_set_header Host $host;
    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;
}

}

and This is the image in Docker Compose:

metabase:

image: ${METABASE_IMAGE}

container_name: metabase

restart: unless-stopped

depends_on:

metabase-postgres:

condition: service_healthy

environment:

TZ: ${TZ}

MB_DB_TYPE: postgres

MB_DB_DBNAME: ${METABASE_DB}

MB_DB_PORT: 5432 # porta INTERNA do container metabase-postgres

MB_DB_USER: ${METABASE_DB_USER}

MB_DB_PASS: ${METABASE_DB_PASSWORD}

MB_DB_HOST: metabase-postgres # nome do serviço acima

MB_PLUGINS_DIR: /plugins

ports:

  - "${METABASE_HOST_PORT}:${METABASE_CONTAINER_PORT}"

volumes:

  - ./metabase/plugins:/plugins

networks:

  - dwnet

When you say “nothing happens,” you’re getting a blank page? yes. just only a message in the center of the page showing not found.

I see what you’re trying to do. I don’t think that’s going to work, it breaks too many assumptions about the browser environment. I would stick with the redirect from / (should probably be location = / to avoid any unintended redirects) to /public/dashboard/xxxxx. May want to use a landing route instead of just / so you can deploy additional dashboards later.