<?php $slhttp = ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') || (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')) ? 'https://' : 'http://';
echo $slhttp;
?>
nginx proxy-pass-php.conf 配置
location @apache
{
internal;
proxy_pass http://127.0.0.1:88;
proxy_set_header X-Forwarded-Proto $scheme;
incldue proxy.conf;
}
location ~ [^/].php(/|$)
{
proxy_set_header X-Forwarded-Proto $scheme;
}