forked from feross/feross.org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx.conf
158 lines (139 loc) · 7.37 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# 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 feross.org;
root /home/feross/www/feross.org/_site;
index index.html;
# Allow file uploads
client_max_body_size 50M;
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;
}
# Old/dumb blog posts I wrote that are no more...
rewrite ^/575-users-waiting-for-studynotesorg-activation-email/?$ / permanent;
rewrite ^/augmented-reality-toys/?$ / permanent;
rewrite ^/awesome-logo-mashups/?$ / permanent;
rewrite ^/beautiful-typography-video-flickermood-20/?$ / permanent;
rewrite ^/big-bang-big-boom/?$ / permanent;
rewrite ^/blasted-cursory/?$ / permanent;
rewrite ^/breathturn-by-hammock/?$ / permanent;
rewrite ^/delayed-gratifaction-as-a-predictor-of-success/?$ / permanent;
rewrite ^/dragonforce-concert/?$ / permanent;
rewrite ^/duckling/?$ / permanent;
rewrite ^/egg-improvements/?$ / permanent;
rewrite ^/empty-walls-by-serj-tankian/?$ / permanent;
rewrite ^/eric-riess-lean-startup-tech-talk/?$ / permanent;
rewrite ^/first-person-shooter-disease/?$ / permanent;
rewrite ^/freedom-of-speech-on-the-internet-part-3-network-classic-1976-film/?$ /freedom-of-speech-on-the-internet/ permanent;
rewrite ^/freedom-of-speech-on-the-internet-part-4-concentration-of-media-ownership/?$ /freedom-of-speech-on-the-internet/ permanent;
rewrite ^/freedom-of-speech-on-the-internet-part-5-george-orwell-rolls-in-his-grave/?$ /freedom-of-speech-on-the-internet/ permanent;
rewrite ^/freedom-of-speech-on-the-internet-part-6-the-internet-revolution-and-citizen-media/?$ /freedom-of-speech-on-the-internet/ permanent;
rewrite ^/freedom-of-speech-on-the-internet-part-7-remix-culture/?$ /freedom-of-speech-on-the-internet/ permanent;
rewrite ^/freedom-of-speech-on-the-internet-part-8-threats-to-free-speech-on-the-net/?$ /freedom-of-speech-on-the-internet/ permanent;
rewrite ^/freedom-of-speech-on-the-internet-part-9-yes-we-can-regulate-culture-with-copyright-law/?$ /freedom-of-speech-on-the-internet/ permanent;
rewrite ^/freedom-of-speech-on-the-internet-part-10-lawrence-lessig-awesome/?$ /freedom-of-speech-on-the-internet/ permanent;
rewrite ^/freedom-of-speech-on-the-internet-part-11-final-thoughts/?$ /freedom-of-speech-on-the-internet/ permanent;
rewrite ^/free-software-foundation-is-awesome/?$ / permanent;
rewrite ^/hello-github/?$ / permanent;
rewrite ^/hyper-fruit/?$ / permanent;
rewrite ^/i-just-discovered-a-cool-website-called-google/?$ / permanent;
rewrite ^/i-won-the-stanford-etl-t-shirt-contest/?$ /stanford-entrepreneurs-nike-t-shirt-just-start-up/ permanent;
rewrite ^/internet-meme-tribute-by-weezer/?$ / permanent;
rewrite ^/josh-keyes/?$ / permanent;
rewrite ^/konami-code/?$ / permanent;
rewrite ^/microsoft-ceo-steve-ballmer-is-coming-to-stanford/?$ /omg-i-just-met-steve-ballmer/ permanent;
rewrite ^/new-twitter-layout/?$ / permanent;
rewrite ^/of-for/?$ / permanent;
rewrite ^/outside-the-box/?$ / permanent;
rewrite ^/quoted/?$ / permanent;
rewrite ^/qwiki-youtube-instant/?$ /youtube-instant-media-frenzy/ permanent;
rewrite ^/remix-culture-part-1-introduction/?$ /freedom-of-speech-on-the-internet/ permanent;
rewrite ^/remix-culture-part-2-freedom-of-speech-broken-promises/?$ /freedom-of-speech-on-the-internet/ permanent;
rewrite ^/searches-climb-5-in-july-google-loses-share/?$ / permanent;
rewrite ^/social-media/?$ / permanent;
rewrite ^/speaking-event-how-to-become-a-ceo-by-21/?$ / permanent;
rewrite ^/very-busy-sorry-for-lack-of-updates/?$ / permanent;
rewrite ^/war-is-like-love-it-always-finds-a-way/?$ / permanent;
rewrite ^/what-is-it-like-to-get-a-job-offer-via-twitter/?$ /youtube-instant-media-frenzy/ permanent;
rewrite ^/what-motivates-us/?$ / permanent;
rewrite ^/why-is-this-website-called-google/?$ / permanent;
rewrite ^/youtube-instant-around-the-world/?$ /youtube-instant-media-frenzy/ permanent;
# Pages that are no more...
rewrite ^/archives/?$ / permanent;
rewrite ^/portfolio/?$ /resume/ permanent;
rewrite ^/stanfordacm.com/?$ / permanent;
# For emails where an extra period might be added to the end of resume url
rewrite ^/resume(\.|/\.)$ /resume/ permanent;
# Categories are tags now...
rewrite ^/category/internets/?$ /tag/random/ permanent;
rewrite ^/category/cs/?$ /tag/programming/ permanent;
rewrite ^/category/copyright/?$ /tag/copyright/ permanent;
rewrite ^/category/essays/?$ /tag/essay/ permanent;
rewrite ^/category/famous/?$ /tag/famous-people/ permanent;
rewrite ^/category/free-software/?$ /tag/freedom/ permanent;
rewrite ^/category/google/?$ / permanent;
rewrite ^/category/hacks/?$ /tag/my-code/ permanent;
rewrite ^/category/inspiration/?$ /tag/inspiration/ permanent;
rewrite ^/category/me/?$ /tag/me/ permanent;
rewrite ^/category/music/?$ /tag/music/ permanent;
rewrite ^/category/politics/?$ /tag/freedom/ permanent;
rewrite ^/category/science/?$ /tag/science/ permanent;
rewrite ^/category/security/?$ /tag/security/ permanent;
rewrite ^/category/stanford-life/?$ /tag/stanford/ permanent;
rewrite ^/category/startups/?$ / permanent;
rewrite ^/category/videogames/?$ /tag/games/ permanent;
rewrite ^/category/web-dev/?$ /tag/web-dev/ permanent;
rewrite ^/category/youtube/?$ /tag/youtube-instant/ permanent;
# Misc redirects
rewrite ^/media/?$ http://fatty.feross.net/ permanent;
rewrite ^/orhskeyclub.com(/.*)?$ http://feross.net$request_uri permanent;
rewrite ^/hacks/like_everything/like_everything.js$ /hacks/facebook-like-everything/script.js permanent;
rewrite ^/hacks/Nim.js/?$ /hacks/nim.js/ permanent;
rewrite ^/Resume_Feross_Aboukhadijeh.pdf$ /resume/ permanent;
rewrite ^/life/?$ https://github.com/feross/Life/issues 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;
}
server {
listen 50.116.11.184:80;
server_name www.feross.org gustave.me www.gustave.me;
rewrite ^ http://feross.org$request_uri permanent;
}