nginx代理缓存

919人浏览 / 0人评论

[root@kache vhost]# cat farm.conf
upstream supertruck{
        server 127.0.0.1:8018;
}
server {
        listen 80;
        server_name supertruck.top www.supertruck.top;
        return 302 https://$server_name$request_uri;

}

server {
        listen 443 ssl;
        server_name supertruck.top www.supertruck.top;
        ssl_certificate             /usr/local/nginx/conf/supertruck.top.crt;
        ssl_certificate_key         /usr/local/nginx/conf/supertruck.top.key;
        ssl_session_timeout         5m;
        ssl_ciphers                 HIGH:!aNULL:!MD5;
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
        ssl_session_cache           shared:SSL:1m;
        ssl_prefer_server_ciphers   on;
    access_log  /usr/local/nginx/logs/host.access.log;
        location / {
                proxy_pass http://supertruck;
        proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_cache_methods GET HEAD;
proxy_cache_revalidate on;
proxy_cache_valid 200 302 10m;
proxy_cache_valid 404 1m;
proxy_cache_valid any 1m;
proxy_cache_min_uses 1;
proxy_cache_use_stale error timeout invalid_header http_500 http_502 http_503 http_504;


}
}    

全部评论