-
-
Notifications
You must be signed in to change notification settings - Fork 836
Expand file tree
/
Copy pathcdn-nginx.conf
More file actions
32 lines (26 loc) · 856 Bytes
/
cdn-nginx.conf
File metadata and controls
32 lines (26 loc) · 856 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# Nginx config for cdn.myflow.sh
# Copy to /etc/nginx/sites-available/cdn.myflow.sh
# Then: ln -s /etc/nginx/sites-available/cdn.myflow.sh /etc/nginx/sites-enabled/
# And: nginx -t && systemctl reload nginx
server {
listen 80;
server_name cdn.myflow.sh;
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl http2;
server_name cdn.myflow.sh;
# SSL certs (use certbot)
ssl_certificate /etc/letsencrypt/live/cdn.myflow.sh/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/cdn.myflow.sh/privkey.pem;
root /var/www/cdn.myflow.sh;
autoindex on;
# Cache static files
location / {
add_header Cache-Control "public, max-age=31536000";
add_header Access-Control-Allow-Origin "*";
}
# Gzip
gzip on;
gzip_types application/octet-stream application/x-tar;
}