• nginx配置之取消index.php同时不影响js,css功能


        server {
            listen       8084;
            server_name  localhost;
    
            #charset koi8-r;
    
            #access_log  logs/host.access.log  main;
                root   "D:/phpStudy/WWW";
           
    
            location / {
                index  index.html index.htm index.php l.php;
                rewrite ^/views/(.*.(css|js|jpg|gif|png))$ /views/$1 last;
                rewrite ^/(.*)$ /index.php/$1 last;
               autoindex  off;
            }
    
            #error_page  404              /404.html;
    
            # redirect server error pages to the static page /50x.html
            #
            error_page   500 502 503 504  /50x.html;
            location = /50x.html {
                root   "D:/phpStudy/WWW";
            }
    
            # proxy the PHP scripts to Apache listening on 127.0.0.1:80
            #
            #location ~ .php$ {
            #    proxy_pass   http://127.0.0.1;
            #}
    
            # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
            #
            location ~ .php(.*)$  {
                fastcgi_pass   127.0.0.1:9000;
                fastcgi_index  index.php;
                fastcgi_split_path_info  ^((?U).+.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_params;
            }
            location ~* .(jpg|gif|png|js|css)$ {
                root D:/phpStudy/WWW/boosens; 
                if (-f $request_filename) {
                expires max;
                break;
              }
            }
            # deny access to .htaccess files, if Apache's document root
            # concurs with nginx's one
            #
            #location ~ /.ht {
            #    deny  all;
            #}
        }
    

      附apache:

    <IfModule mod_rewrite.c>  
    RewriteEngine On  
    RewriteBase /  
    RewriteCond %{REQUEST_FILENAME} !-f  
    RewriteCond %{REQUEST_FILENAME} !-d  
    RewriteRule . /index.php [L]  
    </IfModule>
    

      

  • 相关阅读:
    机器学习——朴素贝叶斯
    机器学习——决策树
    机器学习——线性回归
    机器学习——KNN
    机器学习——数据预处理
    爬虫——scrapy入门
    爬虫——生产者消费者
    想写篇技术性散文
    (景德镇)麻将规则服务描述
    Visual Studio 2013环境下操作vc6/vc7/vc8等低版本平台项目【编译|生成|调试】
  • 原文地址:https://www.cnblogs.com/liuwenbohhh/p/5773190.html
Copyright © 2020-2023  润新知