Add custom map with GeoJSON file served by reverse proxy

Hello,

I have a Debian VM with Docker installed. I have several containers including Metabase and NGINX as a reverse proxy. My “global” NGINX configuration nginx.conf makes static files available, including my GeoJSON static files :

events {
    worker_connections 1024;
}

worker_processes auto;

error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;

http {
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;

    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  /var/log/nginx/access.log  main;

    sendfile        on;
    tcp_nopush      on;
    keepalive_timeout  65;
    gzip  on;

    include /etc/nginx/conf.d/*.conf;    
}

For each container, I have a configuration file which is included in the global configuration file. To make the static files available, I've configured them as follows:

server {
    listen 80;
    server_name static.jb.fr;

    location /geojson/ {
        alias /etc/nginx/html/static/geojson/;
        add_header Content-Type application/json;
    }
}

My containers are all on the same network, so they can communicate with each other. From the Metabase container, if I do a curl, I get a 200 response code:

docker exec -it metabase-metabase-1 curl -I http://static.jb.fr/geojson/departements.json
HTTP/1.1 200 OK
Server: nginx/1.27.4
Date: Wed, 19 Mar 2025 12:56:23 GMT
Content-Type: application/json
Content-Length: 1079714
Last-Modified: Wed, 19 Mar 2025 12:54:54 GMT
Connection: keep-alive
ETag: "67dabe9e-1079a2"
Content-Type: application/json
Accept-Ranges: bytes

But when I want to add the map to the Metabase web interface, specifying the same URL, the API returns a response code 400 and specifies the message The GeoJSON URL returned an invalid content type. I've tried setting the Content-Type header to application/geo+json, then application/json, but to no avail as the error persists. It's as if the API can't contact this URL, whereas in the same container, the curl call returns a code of 200.

My file complies with defined rules:

  • 1MB sized
  • Uses geographic coordinates

What can I do / What's wrong? Thanks for your help!

Here are my diagnostic infos:

{
  "browser-info": {
    "language": "fr-FR",
    "platform": "Win32",
    "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36",
    "vendor": "Google Inc."
  },
  "metabase-info": {
    "databases": [
      "oracle",
      "h2"
    ],
    "run-mode": "prod",
    "plan-alias": "",
    "version": {
      "date": "2025-03-11",
      "tag": "v0.53.6",
      "hash": "a8ca5db"
    },
    "settings": {
      "report-timezone": null
    },
    "hosting-env": "unknown",
    "application-database": "postgres",
    "application-database-details": {
      "database": {
        "name": "PostgreSQL",
        "version": "15.12 (Debian 15.12-1.pgdg120+1)"
      },
      "jdbc-driver": {
        "name": "PostgreSQL JDBC Driver",
        "version": "42.7.4"
      }
    }
  },
  "system-info": {
    "file.encoding": "UTF-8",
    "java.runtime.name": "OpenJDK Runtime Environment",
    "java.runtime.version": "21.0.6+7-LTS",
    "java.vendor": "Eclipse Adoptium",
    "java.vendor.url": "https://adoptium.net/",
    "java.version": "21.0.6",
    "java.vm.name": "OpenJDK 64-Bit Server VM",
    "java.vm.version": "21.0.6+7-LTS",
    "os.name": "Linux",
    "os.version": "6.1.0-31-amd64",
    "user.language": "en",
    "user.timezone": "GMT"
  }
}

UPDATE: SSL has been set up, as shown here:

docker exec -it metabase-metabase-1 curl -I https://static.jb.fr/geojson/departements.json
HTTP/1.1 200 OK
Server: nginx/1.27.4
Date: Wed, 19 Mar 2025 15:23:20 GMT
Content-Type: application/json
Content-Length: 1079714
Last-Modified: Wed, 19 Mar 2025 12:54:54 GMT
Connection: keep-alive
ETag: "67dabe9e-1079a2"
Content-Type: application/json
Accept-Ranges: bytes

But still a code of 200 with message GeoJSON URL failed to load...