How to configure Nginx under Linux to restrict website users to use proxy IP access

  
                

In Linux operations, you sometimes encounter website users who use proxy ip to access. This requires configuring Nginx to restrict access. The following small series will introduce you to how to configure Nginx in Linux system to refuse proxy ip access.

Let's talk about simple structure … a Nginx reverse proxy on the front end, and a Nginx instance app for PHP&hellip on the back end; actually it is a Discuz. Before the CC attack, it is an alert script or a CDN. But this time the attacker no longer hits traffic, but attacks against the database request page, such as search operation … post ID F5. . From the log analysis, it was attacked from 3 URLs. At that time, Nginx was used to match $query_string to return 503… however, the page could not be accessed, so I thought of such a compromise.

First of all, you can see the log of a proxy request:

## Through analysis, the data that the proxy accesses are found on the backend are two IPs. By default, the direct access is true. IP, its IP has only one, and the Internet access through mobile phone 3G\\4G is 2 IP, but if there is an anonymous IP, there is only one IP to the server, which is not very good judgment. . .

[root@ipython conf]# tail -f /var/log/nginx/logs/access.log

Copyright © Windows knowledge All Rights Reserved