zoukankan      html  css  js  c++  java
  • thinkphp nginx配置

    #user  nobody;
    worker_processes  1;
    
    #error_log  logs/error.log;
    #error_log  logs/error.log  notice;
    #error_log  logs/error.log  info;
    
    #pid        logs/nginx.pid;
    
    
    events {
        worker_connections  1024;
    }
    
    
    http {
        include       mime.types;
        default_type  application/octet-stream;
    
        log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                          '$status $body_bytes_sent "$http_referer" '
                          '"$http_user_agent" "$http_x_forwarded_for"';
    
        access_log  logs/access.log  main;
    
        sendfile        on;
        #tcp_nopush     on;
    
        #keepalive_timeout  0;
        keepalive_timeout  65;
    
        gzip  on;
    
        server {
            listen       80;
            server_name  localhost;
           root   html;
            index  index.php index.html index.htm;
            #access_log  logs/host.access.log  main;
    
            location / {
            if (!-e $request_filename){
                        #一级目录
                   rewrite ^/(.*)$ /index.php/$1 last;
                 break;
                     }
               }
          
          location /tk/ {
              if (!-e $request_filename){
                        #二级目录
                   rewrite ^/tk/(.*)$ /index.php/$1 last;
                 break;
                     }
               }
            #error_page  404              /404.html;
    
            error_page   500 502 503 504  /50x.html;
            location = /50x.html {
                root   html;
              }
    
        location ~ .php {
                root           html;
                fastcgi_pass   127.0.0.1:9000;
                fastcgi_index  index.php;
                include 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;
             }
    
          location /nginx_status
            {
                stub_status on;
                access_log off;
            }
    
          location ~ .*.(gif|jpg|jpeg|png|bmp|swf)$
            {
                expires 30d;
            }
    
          location ~ .*.(js|css)?$
            {
                expires 12h;
            }
          location ~ /.
            {
                deny all;
            }
    
        }
    
       include /usr/local/nginx/vhost/*.conf;
    
    }
  • 相关阅读:
    单元测试
    软件工程
    使用工具进行单元测试
    关于软件工程的理解
    使用Junit等工具进行单元测试
    目前对软件工程所存在的问题
    二人组-----五子棋
    使用Junit等工具进行单元测试过程记录
    对软件工程的理解以及存在的问题
    软件设计文档及数据流向图
  • 原文地址:https://www.cnblogs.com/as3lib/p/9777625.html
Copyright © 2011-2022 走看看