本博客的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;
    }
}

php composer 安装阿里云镜像

#doc: https://developer.aliyun.com/composer 全局配置(推荐) composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/ 取消配...

阅读全文

intervention/image处理IOS上传图片翻转问题

#安装 $ composer require intervention/image <?php use Intervention\Image\ImageManagerStatic as Image; //test.png要处理的图片路径 Image::make(&...

阅读全文

使用php hdfs 读取大文件

最近用hdfs上传了一个2.8g的视频,发现用原始的read方式会把整个视频加载到内存,会非常慢。所以使用hdfs的web api里面的按文件偏移量加载的方式。 参考:htt...

阅读全文

欢迎留言