-
Notifications
You must be signed in to change notification settings - Fork 1
/
nginx.conf
62 lines (50 loc) · 1.5 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
server {
server_name www.tjstein.com;
rewrite ^ http://tjstein.com$request_uri?;
}
server {
server_name tjstein.com;
root /var/www/tjstein.com/public;
index index.html;
charset UTF-8;
add_header "X-UA-Compatible" "IE=Edge,chrome=1";
access_log /var/www/tjstein.com/logs/access.log;
error_log /var/www/tjstein.com/logs/error.log;
error_page 404 = /404.html;
location ~ /\.git/* {
deny all;
}
location /nginx_status {
stub_status on;
access_log off;
}
location / {
gzip on;
gzip_http_version 1.0;
gzip_comp_level 2;
gzip_min_length 1100;
gzip_buffers 4 8k;
gzip_proxied expired no-cache no-store private auth;
gzip_types text/html text/plain text/xml application/xml application/xml+rss text/css text/javascript application/javascript application/json;
gzip_disable "MSIE [1-6]\.";
gzip_static on;
}
location ~ \.(jpg|jpeg|png|gif|ico)$ {
root /var/www/tjstein.com/public;
expires 7d;
}
location /feed {
root /var/www/tjstein.com/public;
index index.xml;
set $feed_redirect 'http://feeds.feedburner.com/tjstein';
if ($http_user_agent ~* "FeedBurner") {
set $feed_redirect '';
}
if ($http_user_agent ~* "FeedValidator") {
set $feed_redirect '';
}
if ($feed_redirect ~* "^(.+)$") {
rewrite ^ $feed_redirect? permanent;
}
}
}