• 如何配置nginx支持pathinfo模式 Zane


    nginx.conf

    user  www www;
     
    worker_processes 2;
    worker_cpu_affinity 01 10;
     
    error_log  /data1/logs/nginx_error.log  crit;
     
    pid        /usr/local/webserver/nginx/nginx.pid;
     
    worker_rlimit_nofile 65535;
     
    events
    {
      use epoll;
      worker_connections 65535;
    }
     
    http
    {
      include       mime.types;
      default_type  application/octet-stream;
     
      server_names_hash_bucket_size 128;
      client_header_buffer_size 32k;
      large_client_header_buffers 4 32k;
      client_max_body_size 8m;
     
      sendfile on;
      tcp_nopush     on;
     
      keepalive_timeout 60;
      tcp_nodelay on;
     
      fastcgi_connect_timeout 300;
      fastcgi_send_timeout 300;
      fastcgi_read_timeout 300;
      fastcgi_buffer_size 64k;
      fastcgi_buffers 4 64k;
      fastcgi_busy_buffers_size 128k;
      fastcgi_temp_file_write_size 128k;
    
      server
      {
        listen 80;
        server_name a.com;
        index index.php;
        root /data0/htdocs/a.com/www;
    
            location / {        
             if (!-e $request_filename) {
                rewrite  ^/(.*)$  /index.php/$1  last;
                        break;
                }
        }
        
        location ~ \.php {
            fastcgi_pass 127.0.0.1:9000;
            fastcgi_index index.php;
            include fcgi.conf;
            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;
        }
      }
    } 

    1、虽然最终还是解决问题了,但平日要记录一下重要的东西,网络不是万灵

    2、就算出现问题也要大概知道什么原因?能不能实现?如何实现?

    3、常遇到的问题要反思,举一反三,思考。

  • 相关阅读:
    DES加密/解密
    HMACSha1加密方法
    .Net 计算文件大小函数
    maven项目打包
    08.29
    keep健身计划
    正则验证表单内容
    高德地图API
    Invalid location of tag (div)。
    08.15
  • 原文地址:https://www.cnblogs.com/zhien/p/5283398.html
Copyright © 2020-2023  润新知