码迷,mamicode.com
首页 > 其他好文 > 详细

nginx下配置多站点

时间:2016-03-02 20:15:53      阅读:235      评论:0      收藏:0      [点我收藏+]

标签:nginx

http://www.linuxidc.com/Linux/2011-07/38125.htm




img.xxxx.com



nginx   configTest


add_header Access-Control-Allow-Origin *;
log_format zuren  ‘$remote_addr - $remote_user [$time_local] ‘
                    ‘$request_time $upstream_response_time "$request" ‘
                    ‘$status $body_bytes_sent "$http_referer" ‘
                    ‘"$http_user_agent" "$http_x_forwarded_for"‘;


server{
  listen 80;
  server_name img.xxxx.com;
  index index.php;
  root  /data/www/img;


 if (!-e $request_filename) {
            rewrite ^/(.*)$ /index.php/$1 last;
        }

    location /.git {
        deny all;
        return 403;
    }


    location ~ .*\.php[/]?
    {
      include php_fcgi.conf;
      include pathinfo.conf;
    }

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

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

    access_log /var/log/nginx/img.log  zuren;
  #  access_log off;

}


本文出自 “枷罗博客” 博客,请务必保留此出处http://jhomephper.blog.51cto.com/8558055/1746830

nginx下配置多站点

标签:nginx

原文地址:http://jhomephper.blog.51cto.com/8558055/1746830

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!