+ -
当前位置:首页 → 问答吧 → nginx1.0的thinkphp配置

nginx1.0的thinkphp配置

时间:2011-05-08

来源:互联网

参考了好多配置,终于折腾好了,我配的是泛域名解析,大家把server_name 哪里改成自己的域名, root哪里的目录改下。
  1. server        {
  2.                 listen       80;
  3.                 server_name _;
  4.                 index index.html index.htm index.php default.html default.htm default.php;
  5.                
  6.                 root /var/www/$host;
  7.                 location / {

  8.             try_files $uri $uri $uri/ /index.php?s=$uri&$args;
  9.             index  index.html index.htm index.php default.php;
  10.         }
  11.                 location ~ .*\.(php|php5) {
  12.             include /etc/nginx/fastcgi_params;
  13.                         fastcgi_pass  127.0.0.1:9000;
  14.                         fastcgi_param PATH_INFO $fastcgi_script_name;
  15.                         fastcgi_index index.php;
  16.                 }
  17.                
  18.                 location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ {
  19.                         expires      30d;
  20.                 }
  21.                 location ~ .*\.(js|css)?$ {
  22.                         expires      12h;
  23.                 }

  24.         }
复制代码

作者: sunbo7758   发布时间: 2011-05-08

谢谢啊!!!!!

作者: xiasix   发布时间: 2011-05-08