35 lines
968 B
Bash
Executable File
35 lines
968 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# Exit immediately if a command exits with a non-zero status.
|
|
set -e
|
|
|
|
# MinIO server should be running on port 9000
|
|
MINIO_PORT=9000
|
|
|
|
# Configure nginx to proxy requests to the MinIO server
|
|
sudo tee /etc/nginx/sites-available/minio.sa.vin.conf > /dev/null <<EOL
|
|
server {
|
|
listen 80;
|
|
server_name minio.sa.vin;
|
|
|
|
location / {
|
|
proxy_pass http://
|
|
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;
|
|
}
|
|
}
|
|
EOL
|
|
|
|
# Create a symbolic link to enable the site
|
|
sudo ln -s /etc/nginx/sites-available/minio.sa.vin /etc/nginx/sites-enabled/
|
|
|
|
# Reload nginx to apply changes
|
|
sudo systemctl reload nginx
|
|
|
|
# Use certbot to add SSL certificate for the MinIO server
|
|
sudo certbot --nginx -d minio.sa.vin
|
|
|
|
echo "MinIO server has been set up successfully. Access the server at https://minio.sa.vin"
|