Add full project files
This commit is contained in:
30
scripts/nginx/cdn.modstagram.com.http.conf
Normal file
30
scripts/nginx/cdn.modstagram.com.http.conf
Normal file
@@ -0,0 +1,30 @@
|
||||
# CDN — فقط HTTP (قبل از SSL)
|
||||
# بعد از certbot فایل cdn.modstagram.com.conf را فعال کنید
|
||||
|
||||
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 /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_cache cdn_cache;
|
||||
proxy_cache_valid 200 1h;
|
||||
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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user