Skip to main content
  1. Posts/

Deploy Static Website with Nginx and MinIO

1 min
minio minio nginx
Table of Contents

Setelah install MinIO, pada panduan kali ini akan membahas cara untuk mendeploy static site dengan nginx dan minio. Ini akan mirip seperti mendeploy static site pada AWS cloudfront dengan AWS s3 sebagai penyimpanan object atau file website.

Create bucket
#

Buat bucket dengan nama static

mc mb local/static

Lalu upload file website ke bucket

cd /var/www/site
cp -r ./* local/static

Setting Access Policy ke Public

mc anonymous set public local/static

Install Nginx
#

Install nginx

yum install nginx

Buat dan edit file /etc/nginx/conf.d/static.conf

server {
 listen 80;
 server_name example.com;
 location / {
   rewrite ^/$ /static/index.html break;
   proxy_set_header Host $http_host;
   proxy_pass http://<ip-minio>:9000;
 }
}

Enable dan start nginx

systemctl enable --now nginx

Test akses http://example.com melalui browser Anda.

Related

Install MinIO di Docker
2 mins
minio docker minio
Install Nginx dengan PHP-FPM dan Userdir
5 mins
nginx centos linux php nginx
Setting Reverse Proxy dengan Nginx
6 mins
nginx linux nginx
Menerapkan Rate Limiting dengan NGINX
2 mins
nginx nginx
Custom Log Format in Nginx
1 min
nginx nginx linux
Enable Geoip2 Module in Nginx
2 mins
nginx nginx