Nginx try_files $query_string 为空的解决办法
2015-07-31 09:08
791 查看
在配置Phalcon 的时候,配置的使用是:
发现PHP无法获取$_GET信息。
将
改为
即可解决
server { listen 80; server_name localhost.dev; index index.php index.html index.htm; set $root_path '/var/www/phalcon/public'; root $root_path; location / { try_files $uri $uri/ /index.php; } location ~ \.php$ { try_files $uri =404; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } location ~* ^/(css|img|js|flv|swf|download)/(.+)$ { root $root_path; } location ~ /\.ht { deny all; } }
发现PHP无法获取$_GET信息。
将
try_files $uri $uri/ /index.php;
改为
try_files $uri $uri/ /index.php?$query_string;
即可解决
相关文章推荐
- Nginx/LVS/HAProxy负载均衡软件的优缺点详解
- 文章10:Nginx的超时处理
- 文章9:Nginx accept互斥锁
- 文章6:Nginx中的Epoll事件处理机制
- 文章8:Nginx中与Master-Worker进程通信有关的内容
- 文章5:Nginx源码分析--事件循环
- 文章4:Nginx进程管理之 ngx_master_process_cycle分析
- 文章2:nginx启动过程之main函数
- 文章3:Nginx中与信号有关的内容
- 文章0:Nginx整体分析
- 文章1:Nginx启动过程分析
- 在ubuntu中用apt-get安装LEMP栈(linux+nginx+mysql+php)
- 《深入理解Nginx 模块开发与架构解析》笔记之epoll事件模块
- Nginx配置文件详细说明
- Nginx安装
- 绝对详细!Nginx基本配置、性能优化指南
- nginx的keep-alive配置
- Nginx学习之十一-Nginx启动框架处理流程
- Nginx学习之十二-负载均衡-加权轮询策略剖析
- nginx源码分析—启动流程