PHP Get proxy IP

Source: Internet
Author: User
Tags php website
Recently our PHP website wanted to get the player's IP through a simple $_server["REMOTE_ADDR") unexpectedly get to 127.0.0.1 IP

Because our website is through Nginx Proxy, think of possible to get the player's IP a bit different it

See the $_server[' http_x_forwarded_for ' through this, I changed the code to have no effect

Does not seem to pass over, and then the Internet to find a bit of the original nginx should be set up

Proxy_set_header x-forwarded-for $remote _addr;

Add such a line of code will be able to obtain the IP

Original page http://www.web-jia.com/view.php?a=32

What is node. js? (1)
Qwrap Getting Started Guide
CSS3 Making Windows7 Start Menu
49 Stunning HTML 5 examples (1)
CSS3 Painting: An android Robot!
HTML 50% IE9 Core Intimate or bedfellows
Jscex+jquery UI to create game strength bar
PHP 5.2.10 Release Fixes a number of bugs
2012Q1 Foreign HTML5 mobile development trend
2.1.3 first imitate and then progress
Uncover Google and Facebook's path to development?

PHP Get proxy IP

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.