nginx 缓存配置

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 缓存配置)