Nginx服务器配置WordPress固定连接

2010年7月6日 | 标签: ,
server {
listen 80;
server_name blog.opvps.com;
access_log logs/blog.opvps.com.access.log main;
location / {
root /opt/www-data/blog.opvps.com;
index index.html index.htm index.php;
if (!-e $request_filename) {
rewrite ^.+?(/.*.php)$ $1 last;
rewrite ^ /index.php last;
}
}
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
location ~ .php$ {
root /opt/www/blog.opvps.com;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /opt/www-data/blog.opvps.com$fastcgi_script_name;
include fastcgi_params;
}
}

这样设定配置文件即可,然后在控制面板中设定固定连接即可,即可生成这样的连接http://blog.opvps.com/nginx-wordpress-permalink

目前还没有任何评论.