nginx访问ci框架出现Access denied.
nginx访问ci框架出现Access denied.
Lepus(天兔)web管理台nginx重写
server {
listen 80;
server_name lepus.example.com;
client_max_body_size 10m;
index index.html index.htm index.php;
root /work/www/lepus;
fastcgi_intercept_errors on;
location / {
root /work/www/lepus;
index index.html index.htm index.php;
#rewrite规则如下:
rewrite ^(.)$ /index.php?s=$1 last;
}
location ~ ^(.+.php)(.)$ {
root /work/www/lepus;
fastcgi_index index.php;
fastcgi_split_path_info ^(.+.php)(.)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
#注意:去临时文件夹内找到你的php-cgi,也可能php-cgi.sock不是这么个名字。
fastcgi_pass unix:/dev/shm/php-cgi.sock;
include fastcgi_params;
}
location ~ ..(gif|jpg|jpeg|png|bmp|swf)$ {
expires 30d;
}
location ~ .*.(js|css)?$ {
expires 1h;
}
}
修改php.ini配置文件
cgi.fix_pathinfo=1
已有 0 条评论