- 只有一个入口文件index.php
- 防止js/css/images 中有PHP
- location / {
- root /www/mydomain.com/report.mydomain.com/htdocs;
- index index.php index.html;
- if ($request_filename !~ (js|css|images|robots/.txt|index/.php) ) {
- rewrite ^/(.*)$ /index.php/$1 last;
- break;
- }
- }
- location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|xml)$ {
- access_log off;
- expires 7d;
- }
- location ~ \.php$ {
- if ($request_filename !~ (index/.php) ) {
- return 404;
- }
- }
- location ~ /index.php/ {
- root html;
- fastcgi_pass 127.0.0.1:9000;
- fastcgi_index index.php;
- fastcgi_param SCRIPT_FILENAME /www/mydomain.com/report.mydomain.com/htdocs/index.php;
- include fastcgi_params;
- }