server
linux+nginx1+php+pathinfo
原创
©著作权归作者所有:来自51CTO博客作者seared2008的原创作品,请联系作者获取转载授权,否则将追究法律责任
{
listen 80;
server_name abc.com;
index index.html index.htm index.php;
root /data/www/abc/web_root;
location ~ ^(.+\.php)(.*)$
{
if ($request_filename ~* (.*)\.php) {
set $php_url $1;
}
if (!-e $php_url.php) {
return 403;
}
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.conf;
}
location / {
root /data/www/abc/web_root;
index index.php index.html;
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php/$1 last;
break;
}
fastcgi_index index.php;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
location ~ .*\.(js|css)?$
{
expires 12h;
}
access_log off;
}
}
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
PHP中的PathInfo
PHP中的全局变量$_SERVER['PATH_INFO']是一个很有用的参数,众多的CMS系统在美化自己的URL的时候,都用到了这个参数。对于下面这个网
php pathinfo 搜索引擎 html -
apache、nginx开启pathinfo
apache:在配置文件中加上如上代码nginx:在配置文件中加上如上代码
apache nginx 配置