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 to presign url with custom origin #1389

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kishieel
Copy link

@kishieel kishieel commented Feb 22, 2025

In many Docker-based deployments, MinIO runs in a private network alongside backend services, while being exposed to end users through a reverse proxy. However, MinIO’s SDKs (such as minio-js) generate presigned URLs based on the internal endpoint and port, which are not accessible externally.

This PR introduces the ability to modify the presigned URL's origin before signing. This allows developers to specify an externally reachable URL (e.g., a reverse proxy) instead of the internal MinIO service address.

In my setup, MinIO runs as a container (minio:9000), and my backend (which uses minio-js) is in the same private network. Users, however, access MinIO via an Nginx reverse proxy (https://minio.example.app). Without this change, presigned URLs point to minio:9000, which is unreachable for end users. By allowing origin modification, the backend can generate URLs that correctly route through the reverse proxy, ensuring accessibility.

@matjamr
Copy link

matjamr commented Feb 22, 2025

Thanks for solving this issue. I have noticed this problem recently during development. Can this be merged asap?

@prakashsvmx
Copy link
Member

prakashsvmx commented Feb 25, 2025

The Proxy /LB should be configured to forward host headers in general , also the respective MinIO Envs should be configured accordingly like : MINIO_SERVER_URL . and the network /dns should resolve accodingly
This change is not inline with any other minio sdks.

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

Successfully merging this pull request may close these issues.

3 participants