Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Main Section General Discussion
  • Search

Original visitors IP

General questions about VestaCP
Post Reply
  • Print view
Advanced search
4 posts • Page 1 of 1
marcoscba
Posts: 2
Joined: Wed Dec 28, 2016 5:10 am

Original visitors IP
  • Quote

Post by marcoscba » Wed Dec 28, 2016 6:42 am

SERVER DOES NOT SHOW CUSTOMER IP.

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*;
}
apache2.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*
rpaf

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 PHP:

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.
Top

marcoscba
Posts: 2
Joined: Wed Dec 28, 2016 5:10 am

Re: Original visitors IP
  • Quote

Post by marcoscba » Wed Dec 28, 2016 7:19 pm

ANY HELP?
Top

dsystem
Posts: 55
Joined: Sun Nov 30, 2014 12:27 am

Os: CentOS 6x
Web: nginx + php-fpm
Re: Original visitors IP
  • Quote

Post by dsystem » Thu Dec 29, 2016 11:40 am

What operating system?
Top

dpeca
VestaCP Team
Posts: 473
Joined: Wed Nov 25, 2015 7:30 pm

Re: Original visitors IP
  • Quote

Post by dpeca » Fri Dec 30, 2016 12:35 am

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.
Top


Post Reply
  • Print view

4 posts • Page 1 of 1

Return to “General Discussion”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

Login  •  Register

I forgot my password