內容簡介
如果您在代理伺服器後面運行 WordPress,使用者瀏覽您的網站時顯示的 IP 位址可能不是其真實 IP 位址,而是顯示代理伺服器的 IP 位址。Proxy Real IP 可以透過檢查代理傳送的 HTTP 標頭來修正此問題。
Proxy Real IP 會檢查以下 HTTP 標頭:
X-FORWARDED-FOR, X-FORWARDED, FORWARDED-FOR, FORWARDED, X-REAL-IP
Proxy Real IP 會將使用者的 IP 位址設定為第一個符合簡單 IP 位址(123.123.123.123)規則的 HTTP 標頭。
當運行在代理伺服器後面時,Proxy Real IP 也會正確地設定 $_SERVER['HTTPS'] 變數,以讓 WordPress 可以決定代理伺服器連線是否透過 HTTPS。它會查看 HTTP_X_FORWARDED_PROTO PHP 伺服器變數來判斷這一點。
外掛標籤
開發者團隊
原文外掛簡介
If you’re running WordPress behind a proxy, chances are that the IP address of the user browsing your site won’t show up, instead WordPress will see the IP address of your proxy server. Proxy Real IP sets this straight by looking at the HTTP headers that the proxy sends.
Proxy Real IP looks in the following HTTP headers:
X-FORWARDED-FOR, X-FORWARDED, FORWARDED-FOR, FORWARDED, X-REAL-IP
Proxy Real IP sets the user’s IP address to the first HTTP header defined that matches a simple regular expression of an IP address (123.123.123.123).
Proxy Real IP also sets the $_SERVER[‘HTTPS’] variable correctly when running behind a proxy so that WordPress can determine whether or not the proxy connection is over HTTPS. It looks to the HTTP_X_FORWARDED_PROTO PHP server variable to determine this.
