NGINX关于配置PATHINFO
2015-06-08 10:41
477 查看
最近在群里发现有很多小白不会配置pathinfo现贴出来配置代码照着配置就可以了
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | server { listen 80; server_name xxx.com root /alidata1/wwwroot/xxx; index index.html index.htm index.php; //这里是关键 location ~ \.php { fastcgi_pass 127.0.0.1:9000; #fastcgi_pass unix:/tmp/php-cgi.sock; fastcgi_index index.php; include /usr/local/nginx/conf/fastcgi_params; 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 $document_root$real_script_name; fastcgi_param SCRIPT_NAME $real_script_name; fastcgi_param PATH_INFO $path_info; } access_log /home/wwwlogs/access.log access; } |
相关文章推荐
- linux 把nginx加入到系统服务,并开机自己启动的方法
- 简化的nginx多进程模型demo
- nginx+keepalived实现双机热备高可用
- 在linux下配置nginx+java+php的环境
- 搭建Nginx+Java环境
- Apache与Nginx的区别
- Apache与Nginx的区分比较
- nginx 安装配置 for window
- Nginx整合PHP原理
- linux下nginx+php+mysql 自助环境搭建
- linux下nginx+php+mysql一键安装
- win7-64-nginx-mysql-php
- Nginx配置文件详细说明
- nginx开机自动启动(添加到服务)
- Nginx的proxy_redirect作用
- nginx配备中proxy_redirect的作用(转)
- nginx配置中proxy_redirect的作用(转)
- nginx rewrite重写规则配置详解
- Nginx 重写URI
- ubuntu 安装nginx