# 访问 http://localhost:66/index.html server { listen 66; charset utf-8; location / { # 不存在则直接从后台web内容服务器调取 if (!-e $request_filename) { proxy_pass https://squoosh.app; } root tmp_dir; # 指定存放目录,需手动创建目录 proxy_store on; # 开启本地缓存 proxy_temp_path tmp_path; # 设置反向代理接受的数据临时存储文件的目录,配置生效时候会自动创建 proxy_set_header Accept-Encoding ''; # 不返回压缩内容,避免乱码 proxy_store_access user:rw group:rw all:r; # 设置缓存的读写规则 proxy_set_header x-real-ip $remote_addr; proxy_set_header x-forwarded-for $proxy_add_x_forwarded_for; } } # help https://blog.csdn.net/xiaoxiao_yingzi/article/details/93197397