Android 发表于 2017-3-25 17:03:13

happynetlife 发表于 2017-3-25 15:49
为毛我PHP7.1.2+ nginx/1.10.3+memcached去掉index.php用着一点毛病没有呢?

你是怎么去掉的呢???贴贴代码呗

happynetlife 发表于 2017-3-26 23:40:17

个人配置环境有差异,我的是这样的:

server {
      listen 80;
      server_name www.xxxx.com.cn xxxx.com.cn;
      access_log /home/wwwlogs/www.xxxx.com.cn_nginx.log combined;
      index index.html index.htm index.php;

      include /usr/local/nginx/conf/rewrite/codeigniter.conf;
      root /home/inetpub/xxxx.com.cn/wwwroot;

      if ($host != www.xxxx.com.cn) {
                return 301 $scheme://www.xxxx.com.cn$request_uri;
      }

      #error_page 404 = /404.html;
      #error_page 502 = /502.html;

      location ~ [^/]\.php(/|$) {
                #fastcgi_pass remote_php_ip:9000;
                fastcgi_pass unix:/dev/shm/php-cgi.sock;
                fastcgi_index index.php;
                include fastcgi.conf;
      }

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

      location ~ .*\.(js|css)?$ {
                expires 7d;
                access_log off;
      }

      location ~ /\.ht {
                deny all;
      }
}


codeigniter.conf内容

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

happynetlife 发表于 2017-3-26 23:49:46

我的环境:

happynetlife 发表于 2017-3-26 23:55:16

另外,再附上fastcgi.conf内容,希望能帮到你!!

Android 发表于 2017-3-27 11:46:20

happynetlife 发表于 2017-3-26 23:55
另外,再附上fastcgi.conf内容,希望能帮到你!!

好的谢谢哈。
页: 1 [2]
查看完整版本: 去掉index.php,按照文档说的不行的,部署环境请见内容