Nginx 配置域名 .conf 文件

来源:互联网 发布:matlab矩阵绘制三维图 编辑:程序博客网 时间:2024/05/18 15:54
server  {    listen 80;    server_name .cfc.com www.cfc.com;      #这里是配置域名    index index.html index.htm index.php;    root  /data/wwwroot/chunfengchui/;    #这里是你的项目文件路径    if (!-e $request_filename) {      rewrite ^\/(.*)$ /index.php/$1 last;      break;    }      location ~ \.php {      # comment try_files $uri =404; to enable pathinfo      try_files $uri =404;      fastcgi_pass  unix:/dev/shm/php-cgi.sock;    #这里php.cgi.sock文件根据你的文件目录更改      fastcgi_index index.php;      include fastcgi.conf;      set $path_info "";      set $real_script_name $fastcgi_script_name;      if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") {        set $real_script_name $1;        set $path_info $2;      }        fastcgi_param SCRIPT_FILENAME $document_root$real_script_name;      fastcgi_param SCRIPT_NAME $real_script_name;      fastcgi_param PATH_INFO $path_info;    }    location /nginx_status {      stub_status on;      access_log   off;    }    location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$      {        expires      30d;      }    location ~ .*\.(js|css)?$      {        expires      12h;      }    access_log  /data/wwwlogs/access_nginx.log  combined;  }