美文网首页
nginx 缓存配置

nginx 缓存配置

作者: 小熊你你 | 来源:发表于2018-07-27 16:06 被阅读0次

http {

    include      mime.types;

    default_type  application/octet-stream;

    #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '

    #                  '$status $body_bytes_sent "$http_referer" '

    #                  '"$http_user_agent" "$http_x_forwarded_for"';

    #access_log  logs/access.log  main;

    proxy_cache_path d:/tmp/tmp-test levels=1:2 keys_zone=tmp-test:20m max_size=50g inactive=168h;

    sendfile        on;

    #tcp_nopush    on;

    #keepalive_timeout  0;

    keepalive_timeout  65;

    #gzip  on;

    server {

    autoindex on;

sendfile        on;

        listen      9013;

        server_name  localhost;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location / {

            root d:/netty/data/;

             index  index.html index.htm;

            }

location /tmp-test/ {

                    proxy_cache tmp-test;

                    proxy_cache_valid  200 206 304 301 302 10d;

                    proxy_cache_key $uri;

                    proxy_set_header Host $host:$server_port;

                    proxy_set_header X-Real-IP $remote_addr;

                    proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;

                    proxy_pass http://192.168.100.153:8000/data/;

}

相关文章

  • Nginx 配置缓存

    Nginx 配置缓存

  • 04nginx的缓存配置与其他配置

    1nginx的缓存配置详解 2nginx的压缩功能配置 3nginx的自动列目录配置

  • Nginx静态缓存配置

    Nginx 静态缓存配置方法 我们需要用到nginx两个缓存模块Expires和proxy_cache。Nginx...

  • 静态html页面 缓存

    在index.html里面配置不缓存代码 确保起见 nginx 配置不缓存(单页应用) location = /M...

  • nginx常用配置

    gzip压缩 开启缓存 隐藏nginx版本信息 常用配置

  • Nginx 缓存及HTTPS

    1. Nginx 缓存 客户端缓存 服务端缓存 1.1 缓存配置 proxy_cache_path proxy_c...

  • 【NGINX入门】3.Nginx的缓存服务器proxy_cach

    1. 摘要 本文介绍NGINX缓存机制,配置和参数说明。 2. 内容 2.1 nginx缓存的优点 如图所示,ng...

  • nginx

    nginx centos 7.3 nginx服务器安装及配置文件详解像负载均衡配置(包括健康检查)、缓存(包括清空...

  • nginx 缓存配置

    http { include mime.types; default_type applicatio...

  • Nginx缓存配置

    由于网站访问量比较大,导致后端服务器压力山大,所以就利用Nginx的缓存功能,把后端请求全部缓存下来,类似于生成静...

网友评论

      本文标题:nginx 缓存配置

      本文链接:https://www.haomeiwen.com/subject/pddgmftx.html