自己测试的nginx配置文件:gzip压缩,nginx缓存等等…
http {
include mime.types;
default_type application/octet-stream;
access_log /root/aaa/logs/nginx/access.log;
sendfile on;
#keepalive_timeout 0;
keepalive_timeout 65;
gzip on;
gzip_min_length 1k;
gzip_buffers 4 16k;
gzip_types text/xml text/plain application/json text/css application/javascript application/x-javascript application/rss+xml;
gzip_vary on;
proxy_connect_timeout 500;
proxy_read_timeout 3000;
proxy_send_timeout 500;
proxy_buffer_size 128k;
proxy_buffers 4 128k;
proxy_busy_buffers_size 256k;
proxy_temp_file_write_size 128k;
proxy_temp_path /root/nginx/proxy_temp;
proxy_cache_path /root/nginx/cache levels=1:2 keys_zone=cache_one:100m inactive=30m max_size=2g;
upstream bos_server{
server 127.0.0.1:8088;
keepalive 2000;
}
server {
listen 80;
server_name bos.api.aaa.vip;
rewrite ^(.*)$ https://$host$1 permanent;
}
}