Home  >  Article  >  Topics  >  How to make the Pagoda panel log display the user's real IP after using CDN?

How to make the Pagoda panel log display the user's real IP after using CDN?

藏色散人
藏色散人forward
2019-10-21 11:38:303678browse

How to make the Pagoda panel log display the user's real IP after using CDN?

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 of Pagoda Panel show the real IP for sites using CDN.

How to make the Pagoda panel log display the users real IP after 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;

How to make the Pagoda panel log display the users real IP after using CDN?

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!

Statement:
This article is reproduced at:boke112.com. If there is any infringement, please contact admin@php.cn delete