亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

無法判斷是否 https 請求

無法判斷是否 https 請求

PHP
MMTTMM 2019-03-18 16:53:27
http 網站升級 https 在 https 狀態下打印 $_SERVER ["REQUEST_SCHEME"] => string(4) "http" ["SERVER_PROTOCOL"] => string(8) "HTTP/1.0" 等信息全是http,這是什么原因??   先謝謝大家回答,我的 $_server 全部都沒有標識https;附上我的nginx 配置 server { listen 80; root /www; server_name xx.com; rewrite ^(.*)$ https://$host$1 permanent; index index.html index.php index.htm; location ~ \.php$ { proxy_pass http://127.0.0.1:88; include naproxy.conf; } location ~ /\.ht { deny all; } location / { try_files $uri @apache; } location @apache { internal; proxy_pass http://127.0.0.1:88; include naproxy.conf; } } server { listen 443; root /www; ssl on; ssl_certificate cert/xx.com.crt; ssl_certificate_key cert/xx.com.key; ssl_prefer_server_ciphers on; ssl_session_timeout 10m; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; server_name xx.com; index index.html index.php index.htm; location ~ \.php$ { proxy_pass http://127.0.0.1:88; include naproxy.conf; } location ~ /\.ht { deny all; } location / { try_files $uri @apache; } location @apache { internal; proxy_pass http://127.0.0.1:88; include naproxy.conf; } }
查看完整描述

6 回答

?
jeck貓

TA貢獻1909條經驗 獲得超7個贊

$_SERVER['HTTPS']

$_SERVER['SERVER_PORT'] == 443

查看完整回答
反對 回復 2019-03-18
?
暮色呼如

TA貢獻1853條經驗 獲得超9個贊

nginx fastcgi參數設置了嗎

查看完整回答
反對 回復 2019-03-18
?
人到中年有點甜

TA貢獻1895條經驗 獲得超7個贊

你訪問的這個地址,到達的第一個 WEB 服務器(處理了你這個 HTTPS 的請求的那個),與你在頁面中看到的那個 php 服務器,又不一定是同一個東西。

查看完整回答
反對 回復 2019-03-18
?
RISEBY

TA貢獻1856條經驗 獲得超5個贊

$_SERVER ['HTTP_X_FORWARDED_PROTO']

查看完整回答
反對 回復 2019-03-18
?
米脂

TA貢獻1836條經驗 獲得超3個贊

isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] == "on")
找找這2個有嗎,我用這2個判斷的,ok的

查看完整回答
反對 回復 2019-03-18
  • 6 回答
  • 0 關注
  • 695 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號