修改nginx的虚拟主机配置文件,加入下面的配置,部分配置依据个人情况而定:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | server { listen 80; server_name www.05do.com; index index.html index.htm index.php; root / var /www/html/o5do; location / { rewrite ^/$ /index.php last; rewrite ^/(?!index\.php| public |temp|uploads|robots\.txt)(.*)$ /index.php/ $1 last; } location ~ ^(.+\.php)(.*)$ { fastcgi_pass 127.0.0.1:9000; 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 ; include fastcgi_params; } } |