非常简单!
教程如下:
http://visant.lofter.com/post/1cb75af5_a5a0feb
server {
server_name_in_redirect off;
listen 80;
server_name blog.abc.com;
charset gbk;
index index.html index.htm index.php;
root /博客站点文件路径;
location / {
if (-f $request_filename/index.html){
rewrite (.*) $1/index.html break;
}
if (-f $request_filename/index.php){
rewrite (.*) $1/index.php;
}
if (!-f $request_filename){
rewrite (.*) /index.php;
}
}
location ~ .*\.(php|php5)?$
{
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fcgi.conf;
}
location ~* \.(gif|jpg|jpeg|png|bmp|txt|zip|jar|swf)$ {
valid_referers none blocked *.7qy.com;
if ($invalid_referer) {
rewrite ^/ http://7qy.com/403.gif;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 1h;
}
access_log /dev/null;
error_log /dev/null;
}
}
-------------------------
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。