Knowledgebase
Voting/Rating issues using Nginx Proxy (Tube Script V6)
Posted by Konrad Piwowar on 21 September 2016 08:03 AM

* Please Note *
This article is informational only - we do not provide free technical support for nginx - only for our software. If you would like us to set this up for you, we can do so but will charge for the labour.

If you are using nginx as a proxy in front of apache (using the nginx proxy_pass functionality), you will have an issue with voting on content (it will always say you have already voted) because the IP that comes through to apache will always be 127.0.0.1. To circumvent this, you must do the following:

In Nginx configuration:
Under your proxy_pass line, add:proxy_set_header REMOTE_ADDR $remote_addr;

In admin/config.php:
At the top just after <?, add:
$_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_REMOTE_ADDR'];

This will overwrite the 127.0.0.1 with the users real ip, thus allowing them to vote.

(1 vote(s))
Helpful
Not helpful

Comments (0)
Post a new comment
 
 
Full Name:
Email:
Comments: