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

Reverse Proxy and IPs: Remove or modify?

Questions regarding the Web Server
Apache + Nginx, Nginx + PHP5-FPM
Locked
  • Print view
Advanced search
8 posts • Page 1 of 1
ninespire
Posts: 3
Joined: Sat Jan 09, 2016 11:21 pm

Reverse Proxy and IPs: Remove or modify?

Post by ninespire » Sat Jan 09, 2016 11:30 pm

Hello. I've been working on my server lately and I've noticed that all visitors are under the same IP address, the server's IP. I looked up what was the problem, and I've seen that it's nginx being used as a reverse proxy.

The cons of removing this I've seen is slower load times for your websites, but I really want to ask, what would be the better route?

I've heard of installing libapache2-mod-rpaf, but to my surprise I found it already installed. I am definitely not seeing the visitors' IPs being forwarded to the forum script i'm using. I need to know the IPs of the visitors in case of the need to IP ban someone or stop spam by blocking a range of addresses.

If it is better to uninstall nginx in this circumstance, can someone help me with the steps to do that without damaging my installation of VestaCP?
And if not, can someone tell me how to configure the nginx server to forward visitors' IP addresses to the forum software i'm using?
Or is there a third option I do not know about here? Am I wrong about any of the information I've gathered?

Thanks for the help!
Top

skurudo
VestaCP Team
Posts: 8099
Joined: Fri Dec 26, 2014 2:23 pm
Contact:
Contact skurudo
Website Facebook Google+ Skype
Twitter

Re: Reverse Proxy and IPs: Remove or modify?

Post by skurudo » Tue Jan 12, 2016 10:30 am

OS? Version?
Top

LouisUK
Posts: 11
Joined: Wed Nov 18, 2015 2:15 pm

Re: Reverse Proxy and IPs: Remove or modify?

Post by LouisUK » Tue Jan 12, 2016 4:22 pm

I had the same issue on Ubuntu and I followed this post to fix it: viewtopic.php?f=10&t=6650#p20197
Top

skurudo
VestaCP Team
Posts: 8099
Joined: Fri Dec 26, 2014 2:23 pm
Contact:
Contact skurudo
Website Facebook Google+ Skype
Twitter

Re: Reverse Proxy and IPs: Remove or modify?

Post by skurudo » Tue Jan 12, 2016 9:07 pm

In theory there is two ways:
- reactivate mod rpaf and check rpaf config
- use something else like remoteip

rpaf old and can be a problem in future with apache 2.4,
but in many debian/ubunbu still in apache repo... sad but true
Top

ninespire
Posts: 3
Joined: Sat Jan 09, 2016 11:21 pm

Re: Reverse Proxy and IPs: Remove or modify?

Post by ninespire » Tue Jan 12, 2016 10:02 pm

I'm running Ubuntu 15.04 on my web server. I just tried removing mod-rpaf and enabling remoteip.
I set my remoteip.conf as this:

Code: Select all

<IfModule mod_remoteip.c>
RemoteIPHeader X-Real-IP
RemoteIPInternalProxy 127.0.0.1
RemoteIPInternalProxy xxx.xxx.xxx.xxx // Public IP
</IfModule>
(I actually used the public IP of the webserver, I didn't just put the x's there.)

And when i restarted apache I got this error, all my websites gave me 500 internal server error.

Code: Select all

 * Restarting web server apache2                                         [fail]
 * The apache2 configtest failed.
Output of config test was:
AH00526: Syntax error on line 4 of /etc/apache2/mods-enabled/remoteip.conf:
RemoteIP: Error parsing IP // (The specified IP address is invalid. error) for RemoteIPInternalProxy
Action 'configtest' failed.
I removed that line with the public IP, and my websites were able to be viewed again, but still no IP passthrough.

Help?
Top

skurudo
VestaCP Team
Posts: 8099
Joined: Fri Dec 26, 2014 2:23 pm
Contact:
Contact skurudo
Website Facebook Google+ Skype
Twitter

Re: Reverse Proxy and IPs: Remove or modify?

Post by skurudo » Fri Jan 15, 2016 9:51 pm

Code: Select all

RemoteIPInternalProxy 127.0.0.1 xxx.xxx.xxx.xxx 
Try this.
Top

ninespire
Posts: 3
Joined: Sat Jan 09, 2016 11:21 pm

Re: Reverse Proxy and IPs: Remove or modify?

Post by ninespire » Sat Jan 16, 2016 8:18 pm

That worked! You really saved me there. Thank you!
Top

skurudo
VestaCP Team
Posts: 8099
Joined: Fri Dec 26, 2014 2:23 pm
Contact:
Contact skurudo
Website Facebook Google+ Skype
Twitter

Re: Reverse Proxy and IPs: Remove or modify?

Post by skurudo » Tue Jan 19, 2016 2:03 pm

Nice ;-)
Have a nice day.
Top


Locked
  • Print view

8 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