在nginx下安装了好久,都有问题:所有的URL变成了http://127.0.0.1/index.ph/***,缺少了一个字母“p”
在官方的wiki看到了这个:http://laconi.ca/trac/ticket/1345#comment:9,解决方法是在config.php中添加:
$config['site']['path'] = '.';
哎,头疼。
laconica在nginx下的rewrite规则为:
[code lang='css']server {
listen 80;
server_name yoyoliyang.yo2.cn;
location /js {
root /var/www/laconica;
}
location /stats {
#root /var/www/laconica;
rewrite / /index.php?action=stats;
}
location /theme {
root /var/www/laconica;
}
location /avatar {
root /var/www/laconica;
sendfile on;
}
location = / {
root /var/www/laconica;
index index.php;
}
location / {
root /var/www/laconica;
try_files $uri $uri/ @laconica;
}
location @laconica {
rewrite ^(.+)$ /index.php?p=$1 last;
}
location ~ \.php$ {
root /var/www/laconica;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /var/www/laconica$fastcgi_script_name;
include fastcgi_params;
}
}[/code]
没有评论:
发表评论