forked from feross/feross.org
/
nginx.conf
71 lines (57 loc) · 2.03 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
# The view server (USE NON-PUBLIC PORT)
upstream feross.org-views-frontends {
server 127.0.0.1:7200;
}
server {
listen 50.116.11.184:80;
server_name www.feross.org feross.io www.feross.io feross.co www.feross.co feross.me www.feross.me feross.us www.feross.us aboukhadijeh.com www.aboukhadijeh.com ferossaboukhadijeh.com www.ferossaboukhadijeh.com;
rewrite ^ http://feross.org$request_uri permanent;
}
server {
listen 50.116.11.184:80;
server_name feross.org;
root /home/feross/www/feross.org/_site;
index index.html;
error_page 404 /404.html;
# Only retry if there was a communication error, not a timeout
# on the Node server (to avoid propagating "queries of death"
# to all frontends)
proxy_next_upstream error;
# Log accesses
access_log /home/feross/www/log/feross.org/nginx.log;
expires 1h;
# Set expires max on static file types
location ~* ^.+\.(css|js|jpg|jpeg|gif|png|ico|gz|svg|svgz|ttf|otf|woff|eot|mp4|ogg|ogv|webm)$ {
expires max;
root /home/feross/www/feross.org/_site;
access_log off;
}
# For emails where an extra period might be added to the end of resume url
rewrite ^/resume(\.|/\.)$ /resume/ permanent;
# Opt-in to the future
add_header "X-UA-Compatible" "IE=Edge,chrome=1";
# Prevent framing
add_header X-Frame-Options SAMEORIGIN;
# Pass requests through to view server
location = /views {
proxy_pass_header Server;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Scheme $scheme;
proxy_pass http://feross.org-views-frontends;
}
location = /views/total {
proxy_pass_header Server;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Scheme $scheme;
proxy_pass http://feross.org-views-frontends;
}
location /hacks {
autoindex on;
}
# Try to serve static files
try_files $uri $uri/ =404;
}