欢迎各位兄弟 发布技术文章
这里的技术是共享的
1、在/usr/local/nginx/conf/proxy.conf 最后面加上 proxy_set_header X-Forwarded-Proto $scheme;
2、在对应apache虚拟主机或者httpd.conf 中加入SetEnvIf X-Forwarded-Proto https HTTPS=on 即可传递和接收是否使用的https协议 apache虚拟主机路径为:/usr/local/apache/conf/vhost,找到对应的域名配置文件,建议在虚拟主机里添加
我在 drupal 中的做法是
1) 在 settings.php 的最后一行加上 $conf['HTTPS'] = TRUE;
2) 在 nginx 的 naproxy.conf 的最后一行 加上: proxy_set_header X-Forwarded-Proto $scheme;
3) 在 apache的 虚拟主机文件中 aaaa.bbbb-admin.conf 中 的 Directory 中加上 SetEnvIf X-Forwarded-Proto https HTTPS=on
<Directory /www/web/aaaa_bbbb-admin_com>
Options FollowSymLinks
AllowOverride All
Require all granted
SetEnvIf X-Forwarded-Proto https HTTPS=on
</Directory>
来自 https://blog.csdn.net/gdali/article/details/60126904