Original visitors IP
Original visitors IP
SERVER DOES NOT SHOW CUSTOMER IP.
nginx.conf
apache2.conf
rpaf
CODE PHP:
nginx.conf
Code: Select all
server {
listen XX.XX.XX.XX;
server_name tudoparasaber.com www.XXXXXXXXXX.com;
error_log /var/log/apache2/domains/XXXXXXXXXX.com.error.log error;
# CloudFlare
set_real_ip_from 103.21.244.0/22;
set_real_ip_from 103.22.200.0/22;
set_real_ip_from 103.31.4.0/22;
set_real_ip_from 104.16.0.0/12;
set_real_ip_from 108.162.192.0/18;
set_real_ip_from 131.0.72.0/22;
set_real_ip_from 141.101.64.0/18;
set_real_ip_from 162.158.0.0/15;
set_real_ip_from 172.64.0.0/13;
set_real_ip_from 173.245.48.0/20;
set_real_ip_from 188.114.96.0/20;
set_real_ip_from 190.93.240.0/20;
set_real_ip_from 197.234.240.0/22;
set_real_ip_from 198.41.128.0/17;
set_real_ip_from 199.27.128.0/21;
set_real_ip_from 2400:cb00::/32;
set_real_ip_from 2606:4700::/32;
set_real_ip_from 2803:f800::/32;
set_real_ip_from 2405:b500::/32;
set_real_ip_from 2405:8100::/32;
set_real_ip_from 2c0f:f248::/32;
set_real_ip_from 2a06:98c0::/29;
# use any of the following two
real_ip_header CF-Connecting-IP;
location / {
proxy_pass http://XX.XX.XX.XX:8080;
location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|tif|tiff|css|js|htm|html|ttf|otf|webp|woff|txt|csv|rtf|doc|docx|xls|xlsx|ppt|pptx|odf|odp|ods|odt|pdf|psd|ai|eot|eps|ps|zip|tar|tgz|gz|rar|bz2|7z|aac|m4a|mp3|mp4|ogg|wav|wma|3gp|avi|flv|m4v|mkv|mov|mpeg|mpg|wmv|exe|iso|dmg|swf)$ {
root /home/admin/web/XXXXXXXXXX.com/public_html;
access_log /var/log/apache2/domains/XXXXXXXXXX.com.log combined;
access_log /var/log/apache2/domains/XXXXXXXXXX.com.bytes bytes;
expires max;
try_files $uri @fallback;
}
}
location /error/ {
alias /home/admin/web/********/document_errors/;
}
location @fallback {
proxy_pass http://XX.XX.XX.XX:8080;
}
location ~ /\.ht {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
location ~ /\.bzr/ {return 404;}
disable_symlinks if_not_owner from=/home/admin/web/XXXXXXXXXX.com/public_html;
include /home/admin/conf/web/XXXXXXXXXX.com.conf*;
}
Code: Select all
<VirtualHost XX.XXX.XXX.XX:8080>
ServerName XXXXXXX.COM
ServerAlias www.XXXXXXX.COM
ServerAdmin [email protected]
DocumentRoot /home/admin/web/XXXXXXX.COM/public_html
ScriptAlias /cgi-bin/ /home/admin/web/XXXXXXX.COM/cgi-bin/
Alias /vstats/ /home/admin/web/XXXXXXX.COM/stats/
Alias /error/ /home/admin/web/XXXXXXX.COM/document_errors/
#SuexecUserGroup admin admin
CustomLog /var/log/apache2/domains/XXXXXXX.COM.bytes bytes
CustomLog /var/log/apache2/domains/XXXXXXX.COM.log combined
ErrorLog /var/log/apache2/domains/XXXXXXX.COM.error.log
<Directory /home/admin/web/XXXXXXX.COM/public_html>
AllowOverride All
Options +Includes -Indexes +ExecCGI
php_admin_value upload_max_filesize 50M
php_admin_value max_execution_time 40
php_admin_value post_max_size 38M
php_admin_value memory_limit 8192M
php_admin_value sendmail_path "/usr/sbin/sendmail -t -i -f [email protected]"
php_admin_value open_basedir /home/admin/web/XXXXXXX.COM/public_html:/home/admin/tmp:/bin:/usr/bin:/usr/local/bin:/var/www/html:/tmp:/usr/share:/etc/phpMyAdmin:/etc/phpmyadmin:/var/lib/phpmyadmin:/etc/roundcubemail:/etc/roundcube:/var/lib/roundcube
php_admin_value upload_tmp_dir /home/admin/tmp
php_admin_value session.save_path /home/admin/tmp
</Directory>
<Directory /home/admin/web/XXXXXXX.COM/stats>
AllowOverride All
</Directory>
<IfModule mod_ruid2.c>
RMode config
RUidGid admin admin
RGroups www-data
</IfModule>
<IfModule itk.c>
AssignUserID admin admin
</IfModule>
IncludeOptional /home/admin/conf/web/apache2.XXXXXXX.COM.conf*
Code: Select all
<IfModule rpaf_module>
RPAFenable On
# When enabled, take the incoming X-Host header and
# update the virtualhost settings accordingly:
RPAFsethostname On
# Define which IP's are your frontend proxies that sends
# the correct X-Forwarded-For headers:
RPAFproxy_ips 127.0.0.1 ::1 xx.xx.xx.xx
# Change the header name to parse from the default
# X-Forwarded-For to something of your choice:
# RPAFheader X-Real-IP
</IfModule>
Code: Select all
<? php
echo $ _SERVER [ 'REMOTE_ADDR'];
?>
Last edited by marcoscba on Thu Dec 29, 2016 4:53 am, edited 1 time in total.
Re: Original visitors IP
What operating system?
Re: Original visitors IP
If it's Debian 8, and if you upgraded Vesta from v16 to v17, you have to run (in console, as root) :
/usr/local/vesta/upd/switch_rpath.sh
In all other cases - don't run it.
/usr/local/vesta/upd/switch_rpath.sh
In all other cases - don't run it.