0

I have 2 machines: One holds the Minio running in a Docker container on port 9001 and the other holds the Nginx. I want to access\serve Minio on a path prefix /media i.e. www.mydomain.com/media: I can see that proxy_pass is working fine but I'm getting 404 on static files:

enter image description here

I can see that the main page is getting loaded by checking the favicon and the page title.

Below is my nginx config file:

...
        upstream minio {
            ip_hash;
            server <hostname\IP>:9001;
        }
        server {
            server_name mydomain.com;

...
            location /media {
                rewrite ^/media(/.*)$ $1 break;
                proxy_pass          http://minio/;
                client_max_body_size 0;
                proxy_redirect off;
                proxy_buffering off;
                proxy_set_header    Host               $http_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-Host   $host;
                proxy_set_header    X-Forwarded-Server $host;
                proxy_set_header    X-Forwarded-Port   $server_port;
                proxy_set_header    X-Forwarded-Proto  $scheme;

                chunked_transfer_encoding off;
                proxy_set_header Connection "";
                proxy_http_version 1.1;
                proxy_connect_timeout 300;
            }
...
     }

Any help would be highly appreciated. :)

Janshair Khan
  • 2,577
  • 4
  • 20
  • 44

1 Answers1

0

Unfortunately it seems like this isn't possible and the MinIO team isn't interested in supporting it natively:

https://github.com/minio/minio-js/issues/737

This comment suggests some workarounds, however: https://github.com/minio/minio-js/issues/737#issuecomment-809373153

  • reverse proxy via nginx - rewrite prefix and added option proxy_set_header Host '127.0.0.1:9000'
  • use traefik with stripPrefix and sets static header Host
c.maclean
  • 401
  • 2
  • 9