Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
server {
listen 66;
location / {
if (!-e $request_filename) {
root D:\\Software\\nginx\\conf\\tmp;
proxy_store on;
proxy_store_access user:rw group:rw all:r;
proxy_temp_path cache_tmp;
proxy_set_header x-real-ip $remote_addr;
proxy_set_header x-forwarded-for $proxy_add_x_forwarded_for;
# 中的内容是半段缓存目录中的文件,目录或符号链接是否存在,不存在则直接从后台web内容服务器调取
if(!-e $request_filename)
root /tmp/store # 指定缓存文件的保存目录
proxy_store on # 开启本地缓存
proxy_store_access # 设置缓存的读写规则
proxy_temp_path # 设置反向代理接受的数据临时存储文件的目录,配置生效时候会自动创建
# help
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.