Add full project files

This commit is contained in:
root
2026-07-04 19:24:56 +03:30
parent d54f5441a3
commit b245e7b71a
835 changed files with 30149 additions and 0 deletions

View File

@@ -0,0 +1,46 @@
# CDN — cdn.modstagram.com → کش فایل‌های storage
# مسیر: /etc/nginx/sites-available/cdn.modstagram.com
# IP سرور: 185.164.73.197
proxy_cache_path /var/cache/nginx/cdn levels=1:2 keys_zone=cdn_cache:50m inactive=7d max_size=5g;
server {
listen 80;
server_name cdn.modstagram.com;
location /.well-known/acme-challenge/ {
root /var/www/certbot;
}
location / {
return 301 https://$host$request_uri;
}
}
server {
listen 443 ssl http2;
server_name cdn.modstagram.com;
ssl_certificate /etc/letsencrypt/live/cdn.modstagram.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/cdn.modstagram.com/privkey.pem;
ssl_protocols TLSv1.2 TLSv1.3;
location /storage/ {
proxy_pass http://127.0.0.1:3002/storage/;
proxy_set_header Host api.modstagram.com;
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;
proxy_cache cdn_cache;
proxy_cache_valid 200 1h;
proxy_cache_valid 404 1m;
add_header X-Cache-Status $upstream_cache_status;
add_header Access-Control-Allow-Origin *;
}
location /health {
return 200 "cdn-ok";
add_header Content-Type text/plain;
}
}