zoukankan      html  css  js  c++  java
  • [Nginx]

    CodeIgniter的配置:

    worker_processes  1;
    
    events {
        worker_connections  1024;
    }
    
    http {
        include       mime.types;
        default_type  application/octet-stream;
        sendfile        on;
        keepalive_timeout  65;
        fastcgi_connect_timeout 300s;
        fastcgi_send_timeout 300s;
        fastcgi_read_timeout 300s;
        fastcgi_buffer_size 128k;
        fastcgi_buffers 8 128k;#8 128
        fastcgi_busy_buffers_size 256k;
        fastcgi_temp_file_write_size 256k;
        fastcgi_intercept_errors on;
        #gzip  on;
    
        server {
            listen       80;
            #server_name  localhost;
    
            location / {
                    root   html;
                    index  index.php index.html index.htm;
                    try_files $uri $uri/ /index.php?$uri&$args;
            }
    
            location ~ .php$ {
                    include        fastcgi_params;
                    root           html;
                    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;
            }
        }
    
    }

    ThinkPHP配置:

    worker_processes  1;
    
    events {
        worker_connections  1024;
    }
    
    http {
        include       mime.types;
        default_type  application/octet-stream;
        sendfile        on;
        keepalive_timeout  65;
        fastcgi_connect_timeout 300s;
        fastcgi_send_timeout 300s;
        fastcgi_read_timeout 300s;
        fastcgi_buffer_size 128k;
        fastcgi_buffers 8 128k;#8 128
        fastcgi_busy_buffers_size 256k;
        fastcgi_temp_file_write_size 256k;
        fastcgi_intercept_errors on;
        #gzip  on;
    
        server {
            listen       80;
            #server_name  localhost;
    
            location / {
                    root   html;
                    index  index.php index.html index.htm;
                    #try_files $uri $uri/ /index.php?$uri&$args;
                    if (!-e $request_filename) {
                            rewrite ^(.*)$ /index.php?s=$1 last;
                            break;
                    }
            }
    
            location ~ .php$ {
                    #include        fastcgi_params;
                    include        fastcgi.conf;
                    root           html;
                    fastcgi_pass   127.0.0.1:9000;
                    fastcgi_index  index.php;
                    fastcgi_split_path_info  ^(.+.php)(/.*)$;
                    fastcgi_param  PATH_INFO $fastcgi_path_info;
            }
        }
    
    }

    Laravel配置:

    worker_processes  1;
    
    events {
        worker_connections  1024;
    }
    
    http {
        include       mime.types;
        default_type  application/octet-stream;
        sendfile        on;
        keepalive_timeout  65;
        fastcgi_connect_timeout 300s;
        fastcgi_send_timeout 300s;
        fastcgi_read_timeout 300s;
        fastcgi_buffer_size 128k;
        fastcgi_buffers 8 128k;#8 128
        fastcgi_busy_buffers_size 256k;
        fastcgi_temp_file_write_size 256k;
        fastcgi_intercept_errors on;
        #gzip  on;
    
            server {
                    listen 80;
                    #server_name localhost;
                    root /usr/local/nginx/html/public;
                    index index.html index.php;
    
                    location / {
                            try_files $uri $uri/ /index.php$is_args$query_string;
                    }
    
                    location ~ .php$ {
                            try_files $uri =404;
                            fastcgi_pass 127.0.0.1:9000;
                            fastcgi_index index.php;
                            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                            include fastcgi_params;
                    }
            }
    }

    前提是要启动PHP的FPM(默认端口为9000):

    /usr/local/php/sbin/php-fpm -c /usr/local/php/etc/php.ini -y /usr/local/php/etc/php-fpm.conf
  • 相关阅读:
    EXT FileUploadField 文件上传失败
    CRM自定义页面
    The report server was unable to validate the integrity of encrypted data in the database. (rsCannotValidateEncryptedData) .
    sql存储过程与临时表
    MERGE INTO
    [LeetCode]Merge Two Sorted Lists
    [LeetCode]Search for a Range
    [LeetCode]Length of Last Word
    [LeetCode]Implement strStr()
    [LeetCode]Pascal's Triangle
  • 原文地址:https://www.cnblogs.com/HD/p/5646483.html
Copyright © 2011-2022 走看看