配置如下:

listen        80;
  server_name   www.hongtaofei.com;
 
  location / {
        root    /home/www/shop/public;
        index  index.html index.htm index.php;
 
         try_files $uri $uri/ /index.php?$query_string;
         if (!-e $request_filename){
             rewrite ^/(.*) /index.php last;
         }
  }
 
  location ~ \.php$ {
    root    /home/www/shop/public;
    fastcgi_pass 127.0.0.1:9000;
    fastcgi_index index.php;
    include fastcgi.conf;
    include        fastcgi_params;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  }
}

--------------------- 
**注意:这是个人写的配置,一定要加try_files $uri $uri/ /index.php?$query_string 这行**

相关文章:

  • 2021-12-29
  • 2022-12-23
  • 2022-12-23
  • 2021-05-31
  • 2022-02-26
  • 2021-04-17
  • 2021-12-09
  • 2021-11-25
猜你喜欢
  • 2022-01-18
  • 2021-07-02
  • 2022-12-23
  • 2022-12-23
  • 2021-05-20
  • 2022-12-23
  • 2021-09-26
相关资源
相似解决方案