Many people get MinIO running on their server and then get stuck. The storage part works fine on port 9000, but the moment you try to run MinIO behind a HTTPS reverse proxy with a real domain and a valid SSL certificate, things break. The console redirects to the wrong port, the S3 API returns errors, or the browser shows a certificate warning.
This guide will show you how to get MinIO live behind Nginx or Caddy with TLS and a custom domain.
What You Need to Run MinIO Behind a HTTPS Reverse Proxy
First of all, you must set up MinIO. To do this, you can follow the MinIO installation guide to get your MinIO instance running, then follow these steps to add the proxy layer.
To run MinIO behind a HTTPS reverse proxy, you need:
A server with MinIO running, API on port 9000, and Console on port 9001.
Nginx or Caddy is installed on the same server.
A domain name with DNS access.
Ports 80 and 443 are open in your firewall.
If you need a reliable server, you can run storage-heavy self-hosted stacks on a Dedicated Server with fast NVMe from PerLod, which handles the I/O load MinIO needs without bottlenecks.
Plan Your Subdomains and Point Your DNS Records
When you run MinIO behind a HTTPS reverse proxy, MinIO uses two separate ports internally:
Port
Purpose
9000
S3 API (used by apps, AWS CLI, mc client)
9001
Web Console (the browser UI)
The best way is to give each one its own subdomain:
s3.yourdomain.com: proxies to port 9000 (API)
console.yourdomain.com: proxies to port 9001 (Console)
This will avoid redirect loops and keep your S3 API clean from browser traffic.
Then, log in to your DNS provider, wherever you registered your domain, and add two A records:
HTML/XML
1s3.yourdomain.com A YOUR_SERVER_IP2console.yourdomain.com A YOUR_SERVER_IP
Wait for propagation; DNS changes can take a few minutes to up to an hour. You can check with:
Both should return your server's IP before you continue.
If you need a domain, you can easily get a domain from PerLod and connect it to your server using the A records above.
Set MinIO Environment Variables
When you run MinIO behind a HTTPS reverse proxy, MinIO needs to know its own public URLs. Without these, the console redirects to the internal port (9001) instead of your domain, which breaks the browser UI.
Edit your MinIO environment file. If you installed via the system package, use this command:
Bash
sudonano/etc/default/minio
If you are using Docker, add these to your docker-compose.yml under environment:.
Paste the following configuration with your domains to run MinIO behind a HTTPS reverse proxy using Nginx:
Bash
# --- MinIO S3 API ---server{listen80;server_names3.yourdomain.com;return301https://$host$request_uri;}server{listen443sslhttp2;server_names3.yourdomain.com;ssl_certificate/etc/letsencrypt/live/s3.yourdomain.com/fullchain.pem;ssl_certificate_key/etc/letsencrypt/live/s3.yourdomain.com/privkey.pem;# Required for MinIO — allow special characters in headersignore_invalid_headersoff;# Allow large file uploads — 0 means unlimitedclient_max_body_size0;# Disable Nginx buffering so MinIO streams directlyproxy_bufferingoff;proxy_request_bufferingoff;location/{proxy_passhttp://127.0.0.1:9000;proxy_set_headerHost$http_host;proxy_set_headerX-Real-IP$remote_addr;proxy_set_headerX-Forwarded-For$proxy_add_x_forwarded_for;proxy_set_headerX-Forwarded-Proto$scheme;proxy_http_version1.1;proxy_set_headerConnection"";# Required for S3 multipart uploadschunked_transfer_encodingoff;# Increase timeouts for large file operationsproxy_connect_timeout300;proxy_read_timeout300;proxy_send_timeout300;}}# --- MinIO Web Console ---server{listen80;server_nameconsole.yourdomain.com;return301https://$host$request_uri;}server{listen443sslhttp2;server_nameconsole.yourdomain.com;ssl_certificate/etc/letsencrypt/live/console.yourdomain.com/fullchain.pem;ssl_certificate_key/etc/letsencrypt/live/console.yourdomain.com/privkey.pem;ignore_invalid_headersoff;client_max_body_size0;proxy_bufferingoff;proxy_request_bufferingoff;location/{proxy_passhttp://127.0.0.1:9001;proxy_set_headerHost$http_host;proxy_set_headerX-Real-IP$remote_addr;proxy_set_headerX-Forwarded-For$proxy_add_x_forwarded_for;proxy_set_headerX-Forwarded-Proto$scheme;proxy_http_version1.1;# Required for WebSocket (console uses it)proxy_set_headerUpgrade$http_upgrade;proxy_set_headerConnection"upgrade";proxy_connect_timeout300;proxy_read_timeout300;proxy_send_timeout300;}}
Save and close the file. Then, get TLS certificates with Certbot:
Caddy is simpler if you want automatic TLS without running Certbot. When you run MinIO behind a HTTPS reverse proxy using Caddy, it handles Let's Encrypt certificates automatically.
Both commands should succeed without any SSL errors if Certbot or Caddy issued a valid certificate. If you see SSL errors, check that the certificate covers both subdomains.
Conclusion
In this guide, you learned how to run MinIO behind a HTTPS reverse proxy. By setting the right MinIO environment variables and using a simple Nginx or Caddy reverse proxy, you avoid broken redirects, SSL issues, and S3 errors. After this setup, your apps and S3 clients can communicate with MinIO over a stable, secure endpoint ready for real production use.
No, you can use a single domain and proxy the Console under a /minio/ui/ path, but using two subdomains is much simpler and avoids path-rewrite issues.
Yes, but S3 clients will reject it unless you add --no-verify-ssl (AWS CLI) or --insecure (mc). Use Let's Encrypt for production.
Without it, Nginx buffers the entire file to disk before sending it to MinIO. For large uploads, this causes timeouts and slow transfers.
We use cookies to run PerLod and to understand how the site is used. You can accept everything, or open Manage to turn individual categories off. Cookie policy.