forked from isaacphysics/isaac-cdn
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnginx.conf
More file actions
64 lines (45 loc) · 1.46 KB
/
Copy pathnginx.conf
File metadata and controls
64 lines (45 loc) · 1.46 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
user nginx;
worker_processes auto;
error_log /dev/stdout error;
pid /var/run/nginx.pid;
worker_rlimit_nofile 8192;
events {
worker_connections 8000;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '[$time_local] $remote_addr $remote_user - $host "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
keepalive_timeout 125;
# Do not use etags for caching:
etag off;
# Last-Modified is always added anyway.
# ISAAC CDN
server {
listen 80 default_server;
server_name _;
# Ensure important headers not removed by more add_header lines:
include conf/headers-default.conf;
# Enable compression of static assets:
gzip on;
# Allow long-term caching of resources:
etag off;
add_header Cache-Control "public, max-age=31536000, no-transform";
# Add CORS header:
add_header Access-Control-Allow-Origin "*";
location ~ /\.git {
return 404;
}
location / {
root /var/cdn;
default_type text/plain;
try_files $uri =404;
}
location = /robots.txt {
add_header Cache-Control "public, max-age=86400";
alias /usr/share/nginx/html/cdn-robots.txt;
}
}
}