Nginx Proxy_cache Configuration Description nginx Proxy cache nginx TCP proxy Nginx proxy pass with

Source: Internet
Author: User
#定义代理缓存路径, cache file save path cache initial size and maximum cache time

Proxy_cache_path d:\code\cache levels=1:2 keys_z max_size=20m inactive=1m;


Location/{

#配置上面定义的keys_zone的值
Proxy_cache cache1;

#配置url中包括哪个参数的时候不去缓存中查询
Proxy_cache_bypass $arg _name;

#定义缓存的key
Proxy_cache_key $host $uri$is_args$args;

#缓存时间, if there is cache-control in the header information in response, the cache time in the header will prevail.
Proxy_cache_valid 2m;

#当缓存失效后回源出错的时候可以使用缓存中旧数据, the old is better than wrong
Proxy_cache_use_stale error timeout http_502 http_404;
Proxy_pass http://127.0.0.1:8080;
}

The above describes the Nginx proxy_cache configuration instructions, including the proxy,nginx aspects of the content, I hope that the PHP tutorial interested in a friend helpful.

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.