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
  • 相关阅读:
    md基本语法
    CodeBlocks安装使用、汉化以及更改配色
    hexo+github搭建个人博客教程和各种坑记录
    GB/T 38637.1-2020 物联网 感知控制设备接入 第1部分:总体要求
    山东大学909数据结构与程序设计考研经验分享
    GB/T 39083-2020 快递服务支付信息交换规范
    GB/T 38829-2020 IPTV媒体交付系统技术要求 内容接入
    GB/T 37733.3-2020 传感器网络 个人健康状态远程监测 第3部分:终端技术要求
    GB/T 38801-2020 内容分发网络技术要求 互联应用场景
    GB/T 30269.809-2020 信息技术 传感器网络 第809部分:测试:基于IP的无线传感器网络网络层协议一致性测试
  • 原文地址:https://www.cnblogs.com/HD/p/5646483.html
Copyright © 2011-2022 走看看