本博客的nginx 配置文件

server {
    listen       80;#80和443端口同时监听
    listen       443 ssl;
    server_name  www.koukousky.com koukousky.com;
    index index.html index.htm index.php;
    root  /apps/koukousky;

    #ssl on;
    ssl_certificate    /etc/ssl/koukousky.com.pem;
    ssl_certificate_key   /etc/ssl/koukousky/koukousky.com.key;
    ssl_session_timeout 5m;
    #ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
    ssl_ciphers 'kEECDH+ECDSA+AES128 kEECDH+ECDSA+AES256 kEECDH+AES128 kEECDH+AES256 kEDH+AES128 kEDH+AES256 DES-CBC3-SHA +SHA !aNULL !eNULL !LOW !kECDH !DSS !MD5 !RC4 !EXP !PSK !SRP !CAMELLIA !SEED !3DES';
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_prefer_server_ciphers on;
    //不是www过来的跳转到带www的域名
    if ($http_host !~ "^www.koukousky.com$") {
        rewrite  ^(.*)    http://www.koukousky.com$1 permanent;
    }
    //防盗链图片
    location ~* \.(gif|jpg|png|bmp|zip|pdf)$ {
        valid_referers none blocked *.koukousky.com;
        if ($invalid_referer) {
                return 403;
         }
    }
    //缓存图片
    location ~ .*\.(?:jpg|jpeg|gif|png|ico|cur|gz|svg)$
    {
        expires      7d;
    }
    //缓存js css
    location ~ .*\.(?:js|css)$
    {
        expires      7d;
    }
    }
    //隐藏index.php
    location / {
        if (!-e  $request_filename) {
                rewrite  ^/(.*)$  /index.php/$1  last;
                break;
        }

       index  index.php;

    }
    //解析php
    location ~ \.php {
        //如果是进程文件请换成 fastcgi_pass   unix:/tmp/php-cgi.sock;
        fastcgi_pass   127.0.0.1:9000;

        fastcgi_index  index.php;
        fastcgi_read_timeout 300;
        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$fastcgi_script_name;
        fastcgi_param SCRIPT_NAME $real_script_name;
        fastcgi_param PATH_INFO $path_info;
        include        fastcgi_params;
    }
}

解决 laravel-admin between datetime 假如数据库是时间戳int类型无法筛选。

laravel-admin默认的between->datetime(),查询默认是datetime类型,但是假如数据库是时间戳类型就会报错,又不想改底层文件的话可以试试加自定义筛选功能...

阅读全文

php解析英文语句,自动分解。

参考:https://www.php.net/manual/en/function.str-split.php 最近碰到一个问题,客户的英文地址太长,超出接口api字段长度,所以需要解析下语句分解发送。 ...

阅读全文

记录一个laravel-excel导出表格值为0导出excel显示空的解决方法。

最近在使用laravel-excel导出表格的时候,发现假如字段值为0的情况下,导出的excel中直接显示为空,找到一个方法解决,如下. 在laravel-excel的config配置中...

阅读全文

欢迎留言