-
Notifications
You must be signed in to change notification settings - Fork 0
Replace $_SERVER['REMOTE_ADDR'] according to X-Real-IP or like.
License
yohgaki/realip
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
RealIP module is made for PHP servers behind reverse proxy. ***** SECURITY WARNING ***** NEVER ENABLE THIS MODULE WITHOUT REVERSE PROXY. OTHERWISE YOU MAY HAVE SECURITY PROBLEM. This module sets $_SERVER['REMOTE_ADDR'] according to "realip.realip_header" php.ini. This module is disabled by default for security reason. === How to install === 1. Clone or download files. 2. run "phpize" command in the realip module directory. (phpize command is blong to php-devel package for most Linux) 3. run "./configure --with-realip" 4. run "make && make install" 5. copy realip.ini to ini scan directory. e.g /etc/php.d/ 6. edit realip.ini, then restart your web server. === php.ini EXAMPLES === ;X-Real-IP is the real client IP. (default) realip.enable=1 realip.realip_header="HTTP_X_REAL_IP" ;X-Forwarded-For is the real client IP. realip.enable=1 realip.realip_header="HTTP_X_FORWARDED_FOR" === FUNCTION === mix realip(void) This function returns IP address of true client. Return FALSE when realip is disalbed. Return NULL if there is no remote address. i.e. CLI Auther: Yasuo Ohgaki <yohgaki@ohgaki.net> / <yohgaki@php.net>
About
Replace $_SERVER['REMOTE_ADDR'] according to X-Real-IP or like.
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published