How to set up and obtain real user IP address information after the website is connected to CDN

888u

Last update at :2024-06-28,Edit by888u

Generally when we use the WordPress program, we can see the information of the user's message in the comment background, including the user's IP address. Of course, it also includes the logs we are using to view user log information. However, if we enable the CDN content distribution function, the IP address information obtained is the IP address of the CDN, and the real user information cannot be obtained. Is there any way to achieve this?

A netizen mentioned this problem yesterday. He was using the Nginx WEB environment of the Pagoda panel. After searching here, Snail found a solution for this netizen, and it was finally solved. Here Snail recorded the solution today so that users in need can use it.

This student uses the Pagoda panel. We need to add code to the NGINX configuration file. Modify the configuration file to the location of HTTP.

set_real_ip_from 0.0.0.0/0;real_ip_header X-Forwarded-For;

Add code.

Finally restart the NGINX server to take effect. Let's check whether the log file is the correct user's real IP address. We only need to extract the latest IP search to see if it is our local address, because we ourselves are also visiting it.

Recommended site search: legendary server rental price list, registered domain name, registration-free jsp space, domain name reservation, rent a server, overseas server, Hong Kong vps, latest domain name query, foreign trade host, foreign server,

How to set up and obtain real user IP address information after the website is connected to CDN

All copyrights belong to 888u unless special state
取消
微信二维码
微信二维码
支付宝二维码