When you use a CDN, in your server logs you will see requests only from SkyparkCDN servers. If you want to see real end users IPs, configure the X-Fordarded-For HTTP header on your server. This header will contain all intermediate proxy server IPs.
Nginx
If you have Nginx web server, use the ngx_http_realip_module module. This module is not built-in by default, it should be enabled with the --with-http_realip_module configuration parameter.
Below you can see example lines that should be added to your server configuration (usually in /etc/nginx/nginx.conf). Be informed that the list below is not complete. Contact us to get the updated IPs list.
http { … #Indicates that the SkyparkCDN nodes are trusted set_real_ip_from 13x.2xx.xxx.xxx; set_real_ip_from 13x.2xx.xxx.xxx;
#Indicates that the X-Forwarded-For header contains the IP addresses real_ip_header X-Forwarded-For; ... } |
Restart Nginx.
Apache
For Apache server, install and configure the mod_remoteip module.
For RHEL/CentOS + Apache:
1. Install the required packages
# yum install gcc wget httpd-devel
2. Download the source of the module
# wget -O /usr/local/src/mod_remoteip.from https://raw.github.com/ttkzw/mod_remoteip-httpd22/master/mod_remoteip.c
3. Compile obtained source
# cd /usr/local/src/
# apxs -i -c -n mod_remoteip.so mod_remoteip.c
4. Create the /etc/httpd/conf.d/mod_remoteip.conf file. You can see example lines that should be added to your server configuration below. Be informed that the list below is not complete. Contact us to get the updated IPs list.
#Indicates that the remoteip module should be uploaded from this directory LoadModule remoteip_module modules/mod_remoteip.so #Indicates that the X-Forwarded-For header contains the IP addresses RemoteIPHeader X-Forwarded-For #Indicates that the SkyparkCDN nodes are trusted RemoteIPTrustedProxy 13x.2xx.xxx.xxx; RemoteIPTrustedProxy 13x.2xx.xxx.xxx;
|
5. Save
6. Restart Apache
# service httpd restart
For Debian/Ubuntu + Apache:
1. Install the required packages
# apt-get install gcc wget apache2-prefork-dev
2. Download the module source
# wget -O /usr/local/src/mod_remoteip. from https://raw.github.com/ttkzw/mod_remoteip-httpd22/master/mod_remoteip.c
3. Compile obtained source
# cd /usr/local/src/
# apxs2 -i -c -n mod_remoteip.so mod_remoteip.c
If apxs2 doesn't work, use apxs.
4. Create the /etc/httpd/conf.d/mod_remoteip.conf file. You can see example lines that should be added to your server configuration below. Be informed that the list below is not complete. Contact us to get the updated IPs list.
#Indicates that the remoteip module should be uploaded from this directory LoadModule remoteip_module modules/mod_remoteip.so #Indicates that the X-Forwarded-For header contains the IP addresses RemoteIPHeader X-Forwarded-For #Indicates that the SkyparkCDN nodes are trusted RemoteIPTrustedProxy 13x.2xx.xxx.xxx; RemoteIPTrustedProxy 13x.2xx.xxx.xxx;
|
5. Save changes
6. Copy the module and restart Apache
# mkdir -p /etc/apache2/modules
# cp /usr/lib/apache2/modules/mod_remoteip.so /etc/apache2/modules/
# service apache2 restart