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

When I use MINIO_BROWSER_REDIRECT_URL, minio console always blank page #2766

Closed
foreverrice opened this issue Apr 7, 2023 · 8 comments · Fixed by #2818
Closed

When I use MINIO_BROWSER_REDIRECT_URL, minio console always blank page #2766

foreverrice opened this issue Apr 7, 2023 · 8 comments · Fixed by #2818

Comments

@foreverrice
Copy link

my docker run cfg:
docker run -dt
-p 9101:9000 -p 9191:9090
-v /data/s3storagebak/data:/mnt/data
-e "MINIO_ROOT_USER=admin"
-e "MINIO_ROOT_PASSWORD=xxx"
-e "MINIO_VOLUMES=/mnt/data"
-e "MINIO_BROWSER_REDIRECT_URL=https://xxx.com/minioconsole"
--name "minio_local_bak"
xxx/minio:RELEASE.2023-03-24T21-41-23Z server --console-address ":9090"
my nginx cfg:
location ^~ /minioconsole/ {
proxy_read_timeout 36000s;
proxy_set_header Host $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-Proto $scheme;
rewrite ^/minioconsole/(.*)$ /$1 break;
proxy_pass http://127.0.0.1:9191/;
expires -1;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
client_max_body_size 10240m;
}
I visit the mini console and clicking on some menus always results in a blank page error.
These menus, such as:
image
always have error.
image
image

@harshavardhana
Copy link
Member

@foreverrice this is a Console UI issue moving this to relevant project for analysis.

@avnav0
Copy link

avnav0 commented Apr 12, 2023

i have a similar problem. i'm using a subpath of /minio, the console works and the session request returns 200.

Request URL: http://10.235.77.22/minio/api/v1/session
Request Method: GET
Status Code: 200 OK
Remote Address: 10.235.77.22:80
Referrer Policy: strict-origin-when-cross-origin

but when you try to use certain pages like buckets, you get:

Request URL: http://10.235.77.22/api/v1/buckets
Request Method: GET
Status Code: 404 Not Found
Remote Address: 10.235.77.22:80
Referrer Policy: no-referrer

@galek
Copy link

galek commented May 5, 2023

+1

@tocococa
Copy link

I was having the same issue and it was exactly the same as @avnav88 said, one solution is to add the /api prefix to your Traefik router for your Minio container, but if you have anything else using that same prefix it won't be possible. My solutions was to add a new DNS record pointing from minio.mydo.main to my server and setting that as my Traefik rule and MINIO_BROWSER_REDIRECT variable, although I still think that setting the MINIO_BROWSER_REDIRECT_URL variable should prepend it to requests to the Minio API.

@avnav0
Copy link

avnav0 commented May 23, 2023

just to help out anyone in the future, this worked for me:

podman run \
--name minio_multi \
-p 9002:9002 \
-p 9092:9092 \
-v /home/etldev/minio/data1/:/data-1 \
-v /home/etldev/minio/data2/:/data-2 \
-v /home/etldev/minio/data3/:/data-3 \
-v /home/etldev/minio/data4/:/data-4 \
-e MINIO_HTTP_TRACE=/tmp/minio.log \
-e MINIO_ROOT_USER=admin \
-e MINIO_ROOT_PASSWORD=admin123 \
-e MINIO_BROWSER_REDIRECT_URL=http://localhost:9092/minio/ \
quay.io/minio/minio@sha256:5df02440a371dd5897d4dfe98ed94b22cbc72387a8e50183a4f98578a28a9f76 \
server /data-{1...4} \
--console-address :9092 \
--address :9002

nginx:

##from minio
        # To allow special characters in headers
        ignore_invalid_headers off;
        # Allow any size file to be uploaded.
        # Set to a value such as 1000m; to restrict file size to a specific value
        client_max_body_size 0;
        # To disable buffering
        proxy_buffering off;
        proxy_request_buffering off;
##from minio

        location /minio {

            rewrite   ^/minio/(.*) /$1 break;
            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-Proto $scheme;
            proxy_set_header X-NginX-Proxy true;
            # custom header for api checks
            proxy_set_header X-Custom-Header "minio";

            # This is necessary to pass the correct IP to be hashed
            real_ip_header X-Real-IP;

            proxy_connect_timeout 300;

            # To support websocket
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";

            chunked_transfer_encoding off;
            proxy_pass http://10.235.77.22:9092;

        }

@mrladeia
Copy link

@avnav88
Thanks for sharing. It worked here.

Everything worked great, but just one detail, in sharing.

But in the console, it's showing 127.0.0.1 in the url when I go to share.
image

I tried to add the MINIO_SERVER_URL parameter:

MINIO_SERVER_URL="https://subdomain.example.net/"

But when I put the domain, the console gives this error when I click on login:

{
    "code": 500,
    "detailedMessage": "S3 API Requests must be made to API port.",
    "message": "invalid session"
}

image

Nginx config:

server {
   server_name  subdomain.example.net;

   # Allow special characters in headers
   ignore_invalid_headers off;
   # Allow any size file to be uploaded.
   # Set to a value such as 1000m; to restrict file size to a specific value
   client_max_body_size 0;
   # Disable buffering
   proxy_buffering off;
   proxy_request_buffering off;

   location / {
      proxy_set_header X-Custom-Header "minio";
      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-Proto $scheme;

      proxy_connect_timeout 300;
      # Default is HTTP/1, keepalive is only enabled in HTTP/1.1
      proxy_http_version 1.1;
      proxy_set_header Connection "";
      chunked_transfer_encoding off;

      proxy_pass http://127.0.0.1:9000/; # This uses the upstream directive definition to load balance
   }

   location /minio/ {
      rewrite   ^/minio/(.*) /$1 break;
      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-Proto $scheme;
      proxy_set_header X-NginX-Proxy true;
      # custom header for api checks
      proxy_set_header X-Custom-Header "minio";
   
      # This is necessary to pass the correct IP to be hashed
      real_ip_header X-Real-IP;
   
      proxy_connect_timeout 300;
   
      # To support websockets in MinIO versions released after January 2023
      proxy_http_version 1.1;
      proxy_set_header Upgrade $http_upgrade;
      proxy_set_header Connection "upgrade";
   
      chunked_transfer_encoding off;
   
      proxy_pass http://127.0.0.1:9001/; 
   }


    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/subdomain.example.net/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/subdomain.example.net/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

}


server {
    if ($host = subdomain.example.net) {
        return 301 https://$host$request_uri;
    } # managed by Certbot


   server_name  subdomain.example.net;
    listen 80;
    return 404; # managed by Certbot


}

Is there any parameter to adjust this?

@akarelas
Copy link

akarelas commented Jul 12, 2023

@mrladeia

MINIO_SERVER_URL="https://subdomain.example.net/"

I think this maybe should be MINIO_SERVER_URL="https://subdomain.example.net/minio" or :9000/minio or something like that

@TheManchineel
Copy link

@mrladeia ever found a fix for this issue? @akarelas's suggestion of setting MINIO_SERVER_URL to the same subpath used for the console doesn't work (I get an Unexpected resource error on MinIO startup because the URI cannot have a different path from "/", since that's the API baseurl).

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

Successfully merging a pull request may close this issue.

8 participants