Dev Server Error
# support
a
Using the docker-compose to spin up a Meplum on a dev server. When a access the server, for a split second ( had to screen record to even see it) I get an "Unauthorized" error. Doesn't appear to be any loss of functionality, no errors in any logs or in the browser dev tools. Don't a huge deal, just me being me about having an error. I thought I would post here before I dug into the issue. https://www.medplum.com/docs/self-hosting/running-full-medplum-stack-in-docker 1. I added nginx to the docker-compose (my dev server is at 172.16.1, i'll get to adding DNS someday 😉 :
Copy code
# Single entrypoint
  gateway:
    image: nginx:alpine
    restart: always
    depends_on:
      medplum-app:
        condition: service_healthy
      medplum-server:
        condition: service_healthy
    ports:
      - "172.16.1.7:8080:80"
    volumes:
      - ./nginx.conf:/etc/nginx/conf.d/default.conf:ro
2. Created nginx config:
Copy code
server {
  listen 80;
  server_name _;

  # -----------------------------
  # Medplum app
  # -----------------------------
  location / {
    proxy_pass http://medplum-app:3000;

    # Preserve request context
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

    proxy_set_header Accept-Encoding "";

    sub_filter_types text/html text/css application/javascript application/json;
    sub_filter_once off;
    sub_filter "http://localhost:8103" "http://172.16.1.7:8080";
  }

  # -----------------------------
  # Auth and API routes (Medplum server)
  # -----------------------------
  location ~ ^/(oauth2|fhir|auth|admin|storage|healthcheck) {
    proxy_pass http://medplum-server:8103;

    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  }
}
33 Views