使用nginx安裝owncloud後,出現404頁面

採用nginx安裝owncloud私有云後,出現404頁面,需要開啓path_info功能

1、在php.ini打開,再重啓php-fpm

cgi.fix_pathinfo=1

2、配置nginx.conf

server {

……其他內容

location / {
if (!-e KaTeX parse error: Expected '}', got 'EOF' at end of input: … rewrite ^/(.*) /index.php/$1 last;
break;
}
}
location ~ .php {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi.conf;
set $real_script_name fastcgiscriptname;if(fastcgi_script_name; if (fastcgi_script_name ~ “^(.+?.php)(/.+)$”) {
set $real_script_name $1;
set $path_info $2;
}
fastcgi_param SCRIPT_FILENAME documentrootdocument_rootreal_script_name;
fastcgi_param SCRIPT_NAME $real_script_name;
fastcgi_param PATH_INFO $path_info;

……其他內容

}
}

重啓nginx即可

20190527親自測試可行

測試環境
centos7.4
nginx1.12+php7.2+mysql5.6

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章