原因在于有些nginx的配置里少了这句话

   fastcgi_param HTTPS $https if_not_empty;
导致ecstore的_SERVER['HTTPS']取值为空,不是On

转自博客 [歪麦博客 - 使用 https,$_SERVER ['HTTPS'] 却不等于 on?][1]

要求:http 和 https 协议共存。

配置 CI con­fig 文件遇到一些问题,因为 PHP 中有根据 $_SERVER ['HTTPS'] 来设置 base_url。

解决方法的办法就是 Ng­inx 配置加上:

fastc­gi_­param HTTPS $https if_not_empty;
完整配置如下:

location ~ .*\.(php|php5)?$
{
    try_files $uri =404;
    fastcgi_pass  unix:/tmp/php-cgi.sock;
    fastcgi_param HTTPS $https if_not_empty;
    fastcgi_index index.php;
    include fastcgi_params;
}

注:这个 if_not_empty 额外参数只适合 Ng­inx 1.1.11 之后的版本

相关文章:

  • 2021-05-13
  • 2021-12-13
  • 2021-09-24
  • 2022-12-23
  • 2022-02-08
  • 2022-02-16
  • 2021-04-10
猜你喜欢
  • 2022-12-23
  • 2021-11-17
  • 2022-12-23
  • 2021-03-31
  • 2021-05-20
  • 2021-12-04
相关资源
相似解决方案