nginx下thinkphp的运行环境配置
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 |
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ { #本地测试时图片路径在服务器端,这里可以rewrite一下。以免被执行到thinkphp的rewrite中去 if (!-e $request_filename) { rewrite ^(.*)$ http://www.oicto.com/$1 last; } } location / { index index.html index.htm index.php; if (!-e $request_filename) { rewrite ^(.*)$ /index.php?s=/$1 last; break; } } location ~ \.php(.*)$ { fastcgi_pass 127.0.0.1:4571; fastcgi_index index.php; fastcgi_split_path_info ^((?U).+\.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; } |