nginx 配一个简单的静态文件服务器 和一个虚似机

下面是个图片服务器:

server { 
        listen 80;
        server_name img.xxx.xxx.com;
        root /data/site/img.xxx.xxx.com;
        access_log off;
        location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ { 
                expires  30d;
        }
 }

下面个虚机:

server {  
        listen 80;
        server_name www.xxx.xxx.com;
        index index.html;
        root /data/web/www.xxx.xxx.com;
        access_log /data/log/nginx/www.xxx.xxx.log;
        location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
        {  
                expires  30d;
         }
 }

 

posted @ 2016-12-09 20:50  bass  阅读(195)  评论(0编辑  收藏  举报