$_SERVER['REMOTE_ADDR'] 

Displays server IP. How to see client IP?

PS hosting was just)

  • remove proxy, check X-Forwarded-For and X-Real-IP headers - etki
  • Make var_dump($_SERVER); and look at what element you have transmitted real ip. - Visman
  • You probably installed NGINX. Read the article nginx.org/ru/docs/http/ngx_http_realip_module.html to help set up the server correctly. - GrayHoax
  • Yes, I made the setting according to the instructions from the Internet, nginx is installed) - emtecif
  • VIsman - once again help out) - emtecif

1 answer 1

You probably installed NGINX. Read the article will help set up the server correctly.

The point is in the headers transmitted when nginx works as reverse proxy. For an application running as nginx, any client is local (with the IP address of the server). To avoid this, you need to correct the headers, as indicated in the article.