James 发表于 2018-11-15 08:18:09

CI框架Nginx重写规则

  东西是参考了CU上一哥们的博文,按他的方法没成功我自己改了下,反正现在按这样配是可以重写过来了。网上有的文章说要把 “location ~ \.(php|php5)?$”后面的$去掉,但是我去掉之后url无限跳转增加.有的说要开php_info,我开了也没用
  server
{                listen       80;                server_name xxxx.xxxxx.com;                root/home/wwwroot/xxxx; location / {                index index.html index.htm index.php;                rewrite ^/(.+)$ /index.php last;          }                  location ~ \.(php|php5)?$                        {                                 fastcgi_passunix:/tmp/php-cgi.sock;                              fastcgi_index index.php;                              include fcgi.conf;                        }               location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$                        {                              expires      30d;                        }               location ~ .*\.(js|css)?$                        {                              expires      12h;                        }               access_log off;      }~
页: [1]
查看完整版本: CI框架Nginx重写规则