zoukankan      html  css  js  c++  java
  • nginx服务器去掉url中的index.php 和 配置path_info

    隐藏index.php

     server {
            listen          80;
            server_name     yourdomain.com;
            root            /home/yourdomain/www/;
            index           index.html index.htm index.php;
    
            if (!-e $request_filename) {
                rewrite ^(.*)$ /index.php$1 last;
            }
    
            location ~ .*.php(/.*)*$ {
                include fastcgi.conf;
                fastcgi_pass  127.0.0.1:9000;
            }
    
            access_log logs/yourdomain.log combined;
        }
    

    配置path_info  

    server {
    	listen       80;
    	server_name  test.local;
    
    	location / {
    		root   /www/test;
    		index  index.html index.htm index.php;
                    rewrite ^(.*)$ /index.php$1 last;
    	}
    	location ~*  .php {
    		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;
    		fastcgi_pass    unix:/tmp/php-fpm.sock;
    		include	fastcgi_params;
        }
    }
    

      

  • 相关阅读:
    效能分析
    个人项目词频统计2
    PSP 进度条 柱状图 饼状图
    四人小组项目
    结对编程
    品评历届学生作品
    构建之法终于到手了
    补上周一的进度条进度条:
    燃尽图
    scrum站立会议
  • 原文地址:https://www.cnblogs.com/thrillerz/p/4722878.html
Copyright © 2011-2022 走看看