fix minio scripts

This commit is contained in:
Alex Bezdieniezhnykh
2025-02-26 22:12:41 +02:00
parent 503ddc8c41
commit 0634578864
6 changed files with 73 additions and 28 deletions
-14
View File
@@ -1,14 +0,0 @@
mkdir -p ~/cdn/data
certbot certonly --standalone -d cdn.azaion.com
cd /etc/letsencrypt/live/cdn.azaion.com-0001 || exit
chmod -R 755 privkey.pem
ln -s privkey.pem private.key
chmod -R 755 fullchain.pem
ln -s fullchain.pem public.crt
cd ~ || exit
sh restart-minio.sh
+1 -1
View File
@@ -1,4 +1,4 @@
mc alias set cdn http://localhost:9020 azaion-cdn-admin AzAA2onCdDmNinnn_CDN_1
mc alias set cdn https://cdnapi.azaion.com azaion-cdn-admin AzAA2onCdDmNinnn_CDN_1
mc admin user add cdn azaion-cdn-uploader AaazzA2onCuuPlonad_CerrDN_1
mc admin policy create cdn CDNUploadPolicy uploader_policy.json
+61
View File
@@ -0,0 +1,61 @@
cd /etc/nginx/sites-available || exit
tee -a cdn.azaion.com << END
server {
listen 80;
server_name cdn.azaion.com;
client_max_body_size 20000M;
return 301 https://\$host\$request_uri; # Redirect HTTP to HTTPS
}
server {
listen 443 ssl;
server_name cdn.azaion.com;
client_max_body_size 20000M;
location / {
proxy_pass http://localhost:9021; # Proxy to Minio UI on port 9021 (HTTP internally)
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;
# websockets handling
proxy_http_version 1.1;
proxy_set_header Upgrade \$http_upgrade;
proxy_set_header Connection "upgrade";
}
}
server {
listen 80;
server_name cdnapi.azaion.com;
client_max_body_size 20000M;
return 301 https://\$host\$request_uri; # Redirect HTTP to HTTPS
}
server {
listen 443 ssl;
server_name cdnapi.azaion.com;
client_max_body_size 20000M;
location / {
proxy_pass http://localhost:9020; # Proxy to Minio API on port 9020 (HTTP internally)
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;
# websockets handling
proxy_http_version 1.1;
proxy_set_header Upgrade \$http_upgrade;
proxy_set_header Connection "upgrade";
}
}
END
ln -s /etc/nginx/sites-available/cdn.azaion.com /etc/nginx/sites-enabled/
nginx -t #check syntax
certbot --nginx -d cdn.azaion.com -d cdnapi.azaion.com
systemctl restart nginx
+3 -5
View File
@@ -1,15 +1,13 @@
docker stop minio
docker stop minio
docker rm minio
docker run \
-p 9020:9000 \
-p 9021:9001 \
--name minio \
-v ~/minio/data:/data \
-v /etc/letsencrypt/live/cdn.azaion.com-0001:/certs \
-v /root/cdn/data:/data \
-e "MINIO_ROOT_USER=azaion-cdn-admin" \
-e "MINIO_ROOT_PASSWORD=AzAA2onCdDmNinnn_CDN_1" \
quay.io/minio/minio server /data \
--address ":9000" \
--console-address ":9001" \
--certs-dir /certs
--console-address ":9001"
+1 -1
View File
@@ -1,4 +1,4 @@
{
{
"Version": "2012-10-17",
"Statement": [
{
+1 -1
View File
@@ -1,4 +1,4 @@
{
{
"Version": "2012-10-17",
"Statement": [
{