<p>I'm using minio in Kubernetes and it works great. However, I can't seem to to change the domain and protocol for a pre-signed URL. Minio keeps giving me <code>http://minio.test.svc:9000/delivery/</code> where as I want <code>https://example.com/delivery</code>. I've tried setting <code>MINIO_DOMIN</code> in the pod but it seems to have not effect; I think I'm misusing this var anyway.</p>

Jason Leach
<p>It all depends on how you create your Minio client instance. Specifying host and port as below will make Minio resolve your domain to IP address and use IP rather than the domain. Sample JavaScript code:</p>
<pre class="lang-js prettyprint-override"><code>import { Client as MinioClient } from 'minio';

const client = new MinioClient(
  endPoint: 'yourdomain.com',
  port: 9000,
  accessKey: process.env.MINIO_ACCESS_KEY,
  secretKey: process.env.MINIO_SECRET_KEY,
  useSSL: false
);
</code></pre>
<p>If you create your minio instance like above, your domain will be resolved to it's corresponding IP address, and thus minio will work with <code>http://x.x.x.x:9000</code> as opposed to <code>https://yourdomain.com</code></p>
<p>Also to note, if your client is configured as above, trying to use <code>useSSL: true</code> will throw SSL error as below</p>
<pre><code>write EPROTO 140331355002752:error:1408F10B:SSL routines:ssl3_get_record:wrong 
version number:../deps/openssl/openssl/ssl/record/ssl3_record.c:332
</code></pre>
<p>For minio to use your domain as <code>https://yourdomain.com</code>, you need to have a web server like <code>nginx</code> to proxy your requests to your minio server. Minio has documented how you can achieve this <a href="https://docs.min.io/docs/setup-nginx-proxy-with-minio.html" rel="nofollow noreferrer">here</a>. Add SSL to your domain as documented <a href="https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-18-04" rel="nofollow noreferrer">here</a> then proceed to create your minio client as below:</p>
<pre class="lang-js prettyprint-override"><code>import { Client as MinioClient } from 'minio';

const client = new MinioClient(
  endPoint: 'yourdomain.com',
  port: 443,
  accessKey: process.env.MINIO_ACCESS_KEY,
  secretKey: process.env.MINIO_SECRET_KEY,
  useSSL: true
);
</code></pre>
<p>Note the change in <code>port</code> and <code>useSSL</code> parameters.</p>
<p>Minio will now use <code>https://yourdomain.com</code> in all cases. Signed urls will also be <code>https</code>.</p>
