my blog my blog

Tag: blesta
Blesta的Nginx规则

奶牛就做个小记录,blesta的老大是apache的fun,所以nginx的规则我自己记录下:

server
    {
        listen 80;
        #listen [::]:80;
        server_name blesta ;
        index index.html index.htm index.php default.html default.htm default.php;
        root  /home/wwwroot/blesta;

include enable-php.conf;
 location / {
        error_page     404 = @blesta; #IF file doesn't exist
        log_not_found  off;
    }
    #Core rewrite
    location @blesta {
        rewrite ^(.*)$ /index.php last;
#       rewrite ^(.*)$ /index.php/(.*) /$1  permanent;
    }
        access_log off;
    }

这里的服务器是军哥的lnmp,就这么设置就ok了,但是还需要定义好一个fastcgi_param PHP_ADMIN_VALUE的参数,位于/usr/local/nginx/conf/fastcgi.conf,因为enable-php-conf会调用这个文件。

fastcgi_param PHP_ADMIN_VALUE "open_basedir=$document_root/:/tmp/:/proc/:/home/wwwroot/";