Hot Article
- Centos7 closes and restarts the system firewall and opens firewall ports
- How IID server uses Xshell to connect to Linux (centos) server
- BT panel forgets the background login URL, and the solution to the security entrance verification failure
- The php domain name points to ip, how to use the specified ip address to access a server in the url request domain name in curl mode
- How to purchase a dedicated server
- Error connecting to MySQL: Cant connect to MySQL server (10060)
How to obtain the real IP address after IDGlobal CDN is enabled on the aapanel site (multiple setting methods)
- Author:Kevin
- Category:Anti-attack CDN
- Release Time:2023-01-08
This problem was set up by helping a client during the weekend, here IID .HK sorts out the problem in a simple way. This customer has a WEB environment built using the pagoda panel, and his website has been enabled and accelerated by CDN, but after the acceleration, the real visitor IP address cannot be seen in the log, but the node IP of the CDN, which is not conducive analyze data. Therefore, it is necessary to ensure that the CDN can be used normally, and the IP address of the log can also see the real IP.
Here are a few possible ways to do it.
1. Code modification method
Open aaPanel [Software Store] - [Nginx Settings] - [Configuration Modification], in http {Add the following code at the end, save and restart Nginx, the website log IP is the real IP, if not aapanel can find the corresponding location of the nginx.conf configuration file and modify it.
set_real_ip_from 0.0.0.0/0;
real_ip_header X-Real-IP;
Method 2
Pagoda panel has Nginx firewall (paid plugin). The official website of Pagoda said that the real IP can be obtained by checking the CDN option in the firewall plug-in website list, but my test is invalid. The CDN I use is cloudflare. You can choose the corresponding method according to your own situation, as long as it can achieve your goal.
Finally, we can find out from the log files whether our own visits leave real IP addresses. This can solve the problem that the website does not record the real IP after the CDN is enabled.