nginx 加上清除缓存的功能

server
        {
                listen       80;
                server_name  mm.xxx.com vv.xxx.com ww.xxx.com bb.xxx.com aa.xxx.com ss.xxx.com cc.xxx.com;
                if ( $host ~* (.*)\.(.*)\.(.*))
                {
                        set $domain $1;
                }
                index index.html index.htm index.php;
                root  /var/www/$domain;

                add_header Cache-Control no-cache;
                add_header Cache-Control private;

                location ~ .*\.(php|php5)?$
                        {
                                fastcgi_pass  127.0.0.1:9000;
                                fastcgi_index index.php;
                                include fcgi.conf;
                        }

                location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
                        {
                                expires      30d;
                        }

                location ~ .*\.(js|css)?$
                        {
                                expires      12h;
                        }

        }

猜你喜欢

转载自hao3721.iteye.com/blog/1897850