Nginx/PHP/path_info问题,去掉index.php
2010-04-22 22:33
543 查看
作用是把形如:www.abc.com/index.php/blog/show 的地址美化成 www.abc.com/blog/show ,使用$_SERVER['PATH_INFO']接收变量。
#nginx -s reload 重启NGINX
server { listen 80; server_name myweb; index index.html index.htm index.php; root /home/zhaowei/code; if (!-f $request_filename) { rewrite ^/m-php-framework/(.*)$ /m-php-framework/index.php/$1 last; } location ~ .*/.(php|php5) { #fastcgi_pass unix:/tmp/php-cgi.sock; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fcgi.conf; set $path_info ""; set $real_script_name $fastcgi_script_name; if ($fastcgi_script_name ~ "^(.+?//.php)(/.+)$") { set $real_script_name $1; set $path_info $2; } fastcgi_param SCRIPT_FILENAME /home/zhaowei/code$real_script_name; fastcgi_param SCRIPT_NAME $real_script_name; fastcgi_param PATH_INFO $path_info; } log_format wwwlogs '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" $http_x_forwarded_for'; access_log /data1/logs/wwwlogs.log wwwlogs; }
#nginx -s reload 重启NGINX
相关文章推荐
- nginx服务器去掉url中的index.php 和 配置path_info
- Nginx(PHP/fastcgi)的PATH_INFO问题
- yii2 如何使用 PATH_INFO 模式 并去掉 index.php
- [nginx] 关于解决nginx的php fastcgi模式PATH_INFO问题
- Nginx(PHP/fastcgi)的PATH_INFO问题
- php path_info 在nginx中失效问题
- Nginx(PHP/fastcgi)的PATH_INFO问题
- Nginx配置隐藏index.php和PATH_INFO支持
- nginx的location定义正则后SCRIPT_NAME, PATH_INFO多了index.php
- nginx pathinfo 并隐藏index.php
- Nginx配置隐藏index.php和PATH_INFO支持
- windows下修改nginx pathinfo支持、thinkphp在nginx环境下隐藏index.php
- nginx去掉url中的index.php
- ThinkPHP 在nginx环境下去掉URL中的index.php
- 在APACHE服务器上的访问方式上去除index.php nginx去掉index.php
- nginx去掉index.html改为index.php
- thinkphp项目在apache服务器中“去掉”index.php后出现找不到url的问题
- nginx去掉url中的index.php
- ThinkPHP 在nginx环境下去掉URL中的index.php
- nginx的php fastcgi模式PATH_INFO解决办法Magento正常