云服务器网:购买云服务器和VPS必上的网站!

cdn部署nginx怎么配置

cdn部署nginx怎样配置使用nginx部署cdn的方法以下:upstreambackend{server1.1.1.1;keepalive128;}proxy_temp_path/dev/shm;proxy_cache_path/data/nginx/ca

cdn部署nginx怎样配置

使用nginx部署cdn的方法以下:

upstreambackend{

server1.1.1.1;

keepalive128;

}

proxy_temp_path/dev/shm;

proxy_cache_path/data/nginx/cachelevels=1:2keys_zone=cache_one:500minactive=10dmax_size=1024m;

limit_conn_zone$binary_remote_addrzone=addr:20m;

limit_req_zone$binary_remote_addrzone=req_addr:20mrate=200r/s;

server{

listen80;

server_namewww.iquduo.com;

access_loglogs/e.cn.access.logmain;

error_loglogs/e.cn.error.log;

location~*\.(aac|mp3|mp4|jpeg|jpg|png|gif|js|htm|html|css|avi|mpg|rar|wmv|doc|docx|mov|flv|pdf|edb|ppt|pptx)${

root/data/nginx/cache;

proxy_cache_use_staleerrortimeouthttp_500http_502http_503http_504;

proxy_cachecache_one;

proxy_cache_valid20020630412h;

proxy_cache_revalidateon;

add_headerX-Cache$upstream_cache_status;

add_headerVia"CDN";

#limit_rate_after4096k;

#limit_rate2048k;

#limit_reqzone=req_addrburst=300nodelay;

#limit_req_status503;

#proxy_limit_rate256000;#64000=1Mbperconnections

proxy_cache_key$scheme$proxy_host$uri;

proxy_cache_lockon;

proxy_cache_lock_timeout10s;

proxy_set_headerHost$host;

proxy_set_headerX-Real-IP$remote_addr;

proxy_set_headerX-Forwarded-For$proxy_add_x_forwarded_for;

proxy_passhttp://backend;

proxy_http_version1.1;

proxy_set_headerConnection"";

}

location~/{

proxy_set_headerHost$host;

proxy_set_headerX-Real-IP$remote_addr;

proxy_set_headerX-Forwarded-For$proxy_add_x_forwarded_for;

proxy_passhttp://backend;

proxy_http_version1.1;

proxy_set_headerConnection"";

}

}

本文来源:https://www.yuntue.com/post/79335.html | 云服务器网,转载请注明出处!

关于作者: yuntue

云服务器(www.yuntue.com)是一家专门做阿里云服务器代金券、腾讯云服务器优惠券的网站,这里你可以找到阿里云服务器腾讯云服务器等国内主流云服务器优惠价格,以及海外云服务器、vps主机等优惠信息,我们会为你提供性价比最高的云服务器和域名、数据库、CDN、免费邮箱等企业常用互联网资源。

为您推荐

发表回复

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