/
.nginx.conf
83 lines (64 loc) · 2.33 KB
/
.nginx.conf
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# While this comment exists, this nginx configuration is yet untested.
user root;
worker_processes 1;
error_log /home/CURRENT_USER/bootstrap-cdn/logs/error.log;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /home/CURRENT_USER/bootstrap-cdn/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
server_names_hash_bucket_size 64;
access_log /home/CURRENT_USER/bootstrap-cdn/logs/access.log main;
sendfile on;
keepalive_timeout 65;
gzip on;
gzip_comp_level 4;
gzip_disable "msie6";
gzip_proxied any;
gzip_vary on; # Adds 'Vary: Accept-Encoding'
# Manually adding this for 'User-Agent'
server_tokens off;
upstream nodeapp {
server 127.0.0.1:3333 fail_timeout=10s slow_start=10s max_fails=3;
# Because this file is used both on dev and test, if dev fails it will
# not backup anywhere.
server dev.bootstrapcdn.com backup;
}
server {
listen 80 default_server;
server_name _;
# Should be more then large enough, revisit if getting 413 errors.
client_max_body_size 4m;
root /home/CURRENT_USER/bootstrap-cdn/public;
expires 30d;
add_header X-Powered-By "MaxCDN";
add_header X-Hello-Human "You must be bored. You should work for us. Email jdorfman+theheader@maxcdn.com or @jdorfman on the twitter.";
# Quick fix because root isn't working as expected, revisit
# because this is a really ugly way of doing it.
location /bootswatch/ {
root /home/CURRENT_USER/bootstrap-cdn/public;
}
location /bootstrap/ {
root /home/CURRENT_USER/bootstrap-cdn/public;
}
location /twitter-bootstrap/ {
root /home/CURRENT_USER/bootstrap-cdn/public;
}
location /font-awesome/ {
root /home/CURRENT_USER/bootstrap-cdn/public;
}
location / {
proxy_pass http://nodeapp;
}
}
server {
server_name bootstrapcdn.com;
return 301 http://www.bootstrapcdn.com$request_uri;
}
}
# vim: ft=nginx: