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 Web Server
  • Search

Real IP with/through NGINX reverse proxy

Questions regarding the Web Server
Apache + Nginx, Nginx + PHP5-FPM
Post Reply
  • Print view
Advanced search
4 posts • Page 1 of 1
injeckt
Posts: 5
Joined: Mon Sep 08, 2014 2:51 pm

Real IP with/through NGINX reverse proxy
  • Quote

Post by injeckt » Mon Sep 08, 2014 3:01 pm

Hi there. I've been using VestaCP since not long ago and have found that neither the forum or CMS register the real IP of my visitors.

I wonder how to register the real IP of my visitors and not the IP of the server itself (the same with NGINX reverse proxy and Apache).

I have installed version 0.9.8-10 of VestaCP on Ubuntu Server 14.04 LTS 64-bits

Thank you very much in advance. A greeting.
Top

rhonk
Posts: 1
Joined: Wed Sep 10, 2014 5:12 pm

Re: Real IP with/through NGINX reverse proxy
  • Quote

Post by rhonk » Wed Sep 10, 2014 5:19 pm

I found a guide that may be useful. http://thejoyofstick.com/blog/2013/04/1 ... ind-nginx/
Top

injeckt
Posts: 5
Joined: Mon Sep 08, 2014 2:51 pm

Re: Real IP with/through NGINX reverse proxy
  • Quote

Post by injeckt » Thu Sep 11, 2014 10:42 am

rhonk wrote:I found a guide that may be useful. http://thejoyofstick.com/blog/2013/04/1 ... ind-nginx/
Yes, I have tried to do just that, but I see is configured in VestaCP by default, but I dont know because it doesn't works correctly. I dont know if it is a bug or some kind of problem I have VestaCP. I have installed VestaCP on several servers and they all give me the same problem (without change configurations).

I still dont know how to fix it or what might be wrong.
Top

injeckt
Posts: 5
Joined: Mon Sep 08, 2014 2:51 pm

Re: Real IP with/through NGINX reverse proxy
  • Quote

Post by injeckt » Sat Nov 22, 2014 7:33 pm

I still have the same problem. The only solution I've found, example for WordPress, is adding:

Code: Select all

if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
  $ips = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']);
  $_SERVER['REMOTE_ADDR'] = $ips[0];
}
in a functions.php file. Is there any solution to this? I still do not know because it shows me the IP reverse proxy and not the IP of the user connecting to the web.
Top


Post Reply
  • Print view

4 posts • Page 1 of 1

Return to “Web Server”



  • 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