Skip to content

Instantly share code, notes, and snippets.

@Li-blog
Created March 28, 2016 13:10
Show Gist options
  • Save Li-blog/30d07ffaf4b28b9495d1 to your computer and use it in GitHub Desktop.
Save Li-blog/30d07ffaf4b28b9495d1 to your computer and use it in GitHub Desktop.
server {
listen 80;
server_name blog.wangjinli.com www.wangjinli.com wangjinli.com;
index index.html index.htm index.php default.html default.htm default.php;
root /home/wwwroot/www.wangjinli.com;
if ($host = 'blog.wangjinli.com';) {
rewrite ^/(.*)$ http://wangjinli.com/blog/$1 permanent;
}
include wordpress.conf;
location ~ [^/]\.php(/|$) {
try_files $uri =404;
fastcgi_pass unix:/tmp/php-cgi.sock;
fastcgi_index index.php;
include fastcgi.conf;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {
expires 30d;
}
location ~ .*\.(js|css)?$ {
expires 12h;
}
access_log off;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment