As we all know, after a site uses CDN, neither the commenter IP nor the user IP displayed in the log is the user's real IP, but the CDN node IP or transit IP, etc. Today I will focus on telling you how to make the logs ofPagoda Panelshow the real IP for sites using CDN.
##Log in to the Pagoda Panel Backend>> Software Store>> Running Environment>> Click the corresponding "Settings" on the right side of nginx>> In nginx In the management, click "Configuration Modification" on the left side>> Add the following two lines of code after http{, as shown below:set_real_ip_from 0.0.0.0/0; real_ip_header X-Forwarded-For;Save and then restart nginx That’s it. Remember, be sure to back up before operating! ! After completing this, return to the Pagoda log and you will see that the log no longer displays the CDN’s node IP or transit IP, but the user’s real IP.
The above is the detailed content of How to make the Pagoda panel log display the user's real IP after using CDN?. For more information, please follow other related articles on the PHP Chinese website!