php

opcache

1 https://learnku.com/articles/18782

fpm

2.https://www.kancloud.cn/digest/php-src/136260

nginx

nginx

http{

sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 10;
types_hash_max_size 2048;
client_header_timeout 10;
client_body_timeout 10;
reset_timedout_connection on;
server_tokens off;
client_max_body_size 1024M;
server_names_hash_bucket_size 64;
server_name_in_redirect off;
client_header_buffer_size 4k;
include /etc/nginx/mime.types;
default_type application/octet-stream;
send_timeout 5s;

map $http_x_forwarded_for $real_ip{
    ""  $remote_addr;
    ~^(?P<firstAddr>[0-9\.]+),?.*$  $firstAddr;
}

log_format main '$real_ip - $http_cookie [$time_local] '
            '"$request" $status "$http_referer" '
           '"$http_user_agent" "$remote_addr"' ;
access_log /var/log/nginx/access.access.log main;
error_log /var/log/nginx/error.log;
gzip on;
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;

limit_conn_zone $real_ip zone=limit_ip_zone:10m;
limit_conn limit_ip_zone 10;
limit_conn_log_level error;

limit_req_zone $real_ip zone=limit_req_zone:10m rate=5r/s;
#limit_req zone=limit_req_zone burst=5 nodelay;
limit_req_log_level error;

}

fastcgi

Tagged:

发表评论

电子邮件地址不会被公开。 必填项已用*标注