-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx.conf
43 lines (34 loc) · 1.19 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
server {
server_name felix.loc;
listen 8080;
log_format main '$remote_addr - $remote_user [$time_local] $status '
'"$request" $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
root /Users/felix/Projects/sandbox/felixleong.com/deploy;
access_log /usr/local/var/log/nginx/felix.loc-access.log main;
error_log /usr/local/var/log/nginx/felix.loc-access.log error;
index index.html;
location / {
# Backward compatibility fix
rewrite "^/(\d{4}/\d{2}/.*)$" /blog/$1 permanent; # Redirect all my old WP paths to the current path
rewrite "^/(feed\/*.*)$" /blog/$1 permanent; # Fixed
# Generic rule
rewrite ^/(.*)/$ /$1 last;
try_files $uri $uri/index.html $uri.html =404;
error_page 404 /404.html;
}
}
# Images
server {
server_name upload.felixleong.com;
charset utf-8;
# Site media
location / {
alias /home/felix/www/felixleong.com/wp-content/filestore/;
}
}
# Redirect
server {
server_name www.felixleong.com;
rewrite ^(.*) http://felixleong.com$1 permanent;
}