Theo's Typesafe CultTTC
Theo's Typesafe Cult10mo ago
1 reply
DGCP3

Minio not working with caddy proxy

I'm using Caddy to proxy my backend and serve a React Vite app build file and other proxies.

   handle_path /storage/* {
      reverse_proxy minio:9003
   }
   
   handle {
      root * /usr/share/caddy
      try_files {path} /index.html
      file_server
  }



client
export const bucket = new Client({
  endPoint: "localhost",
  pathStyle: false,
  port: 9003,
  useSSL: true,
  accessKey: "xxx",
  secretKey: "xxx",
});


docker compose file
  minio:
    container_name: minio
    image: minio/minio
    ports:
      - "9003:9003"
      - "9001:9001"
    command: server --console-address ":9001" --address ":9003" /data
    env_file:
      - ./.env
    volumes:
      - ./volume/minio:/data
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
      interval: 30s
      timeout: 5s
      retries: 3

url generator function
const presignedUrl = await c.var.bucket
.presignedGetObject(bucketName,fileName,60 * 5)
.then((url)=>url.replace(`http://${env.MINIO_ENDPOINT}:${env.MINIO_PORT}`,"/storage")
 );


when I try to use the URL generated by generator function it shows signitureDoesNotMatch error
Was this page helpful?