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

nginx添加一个站点

时间:2016-01-27 23:07:56      阅读:165      评论:0      收藏:0      [点我收藏+]

标签:

server {
  listen 80;
  server_name demo.abc.com ;
  root /Users/pa200318/demo.cp.com/trunk;
  index index.php index.html;
  location ~* \.(jpg|jpeg|gif|css|png|js|ico|html)$ {
    access_log off;
    expires max;
  }
  location ~ \.php$ {
    include /usr/local/etc/nginx/fastcgi_params;
    include /usr/local/etc/nginx/fastcgi_web;
    include /usr/local/etc/nginx/fastcgi_mysql;
    include /usr/local/etc/nginx/fastcgi_ldap;
  }

  location ~ /\.ht {
    deny  all;
  }

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

}

 仅供参考

nginx添加一个站点

标签:

原文地址:http://www.cnblogs.com/pa200318/p/5164552.html

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