Gateway ST Advanced Usage
Advanced usage for the single-tenant Gateway
You can add several access grants to the config.yaml. using this format:
You can see the path to the default config file config.yaml with this command:
- Run Gateway ST to host a static website
You can run a gateway with specifying the access grant (or its name) with the option --access, for example:
or with the name of the access grant from your config (see Add multiple Access Grants)
You can also run a gateway to handle a bucket as a static website. Make sure to limit the access to the exposed buckets.
or with the name of the access grant from your config (see Add multiple Access Grants)
Now you can navigate to http://localhost:7777/site/ to see the bucket site as XML or to http://localhost:7777/site/index.html to see a static page, uploaded to the bucket site.
You can publish this page to the internet, but in this case, you should run your gateway with the option --server.address local_IP:local_Port (replacelocal_IPwith the local IP of your PC andlocal_Port with the port you want to expose).
If you uselocalhost or 127.0.0.1 as your local_IP, you will not be able to publish it directly (via port forwarding for example), instead, you will have to use a reverse proxy here.
You can use the Minio caching technology in conjunction with the hosting of a static website.
The following example uses /mnt/drive1, /mnt/drive2 ,/mnt/cache1 ... /mnt/cache3 for caching, while excluding all objects under bucket mybucket and all objects with '.pdf' extensions on a S3 Gateway setup. Objects are cached if they have been accessed three times or more. Cache max usage is restricted to 80% of disk capacity in this example. Garbage collection is triggered when the high watermark is reached (i.e. at 72% of cache disk usage) and will clear the least recently accessed entries until the disk usage drops to the low watermark - i.e. cache disk usage drops to 56% (70% of 80% quota).
Export the environment variables before running the Gateway:
Cache disks are not supported, because caching requires the atime function to be enabled.
Setting MINIO_BROWSER=off env variable would disable the Minio browser. This would make sense if running the gateway as a static website in production.
Then run the gateway with static site enabled.