Report this

What is the reason for this report?

IP visitor comments is exactly like my IP droplet. So I can not cut off the spammers by their IP

Posted on January 12, 2017

I have site on wordpress, and IP visitor comments is exactly like my IP droplet. So I can not cut off the spammers by their IP. How to make that when someone write a comment on the website, admin panel recorded the actual visitor’s IP?



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

If this block proxy_set_header X-Forwarded-For $ proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $ scheme;

is added to

location ~ \ .php $ { fastcgisplitpathinfo ^ (+ \ php…) $ (*.); root $ rootpath; include / etc / nginx / fastcgiparams; fastcgipass 127.0.0.1:9000; fastcgiparam REMOTEADDR $ httpxrealip; fastcgiindex index.php; }

all * .php starts to work! But IP is not transmitted at all, there is an empty space in site page where is to be output IP.

Are you using a reverse proxy? Did you check the access logs?

@dvolob

How was your Droplet setup? Did you use a one-click image or did you install all software yourself? We need to know more about how your Droplet was setup before we can help.

To me, initially, it seems like you’re using a reverse proxy and that correct headers are not being sent, so when WordPress queries for the visitor IP, it’s reverting to the server IP as it can’t determine the real IP.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.