Recently, AdSense kept showing a warning about revenue loss risk - you need to fix some ads.txt file issues to avoid serious income damage. Although it’s just a few cents, seeing this prompt still makes you want to properly resolve it, haha.
This is the kind of warning:

adsense
Here I share the correct approach to handle this issue.

1. First, download the ads.txt file from AdSense locally and upload it to your server.

Open it in the browser, you should see the ads.txt displayed correctly.
adsense_ads
At first, I thought this would solve the problem, but after a couple of days it was still there. At this point, the next step is troubleshooting.

2. Check main domain redirect settings

Google AdSense actually does not check the www subdomain, but the main domain bobobk.com, and www.bobobk.com is a subdomain. If the main domain does not correctly redirect, AdSense will not find the ads.txt file.
So the fix is simple: make sure bobobk.com properly redirects to www.bobobk.com.

2.1 Check CDN settings

My problem was a misconfigured CDN. Here’s the correct method for Cloudflare as an example. Choose your site, go to Page Rules, and set it as shown in the image below.
cf_301
Note that the URL ends with https://www.bobobk.com/$1 — do NOT forget the $1. Because of missing $1, Google could not fetch ads.txt from bobobk.com.

2.2 Check web server configuration

Here I use Nginx site configuration as an example.
Make sure to include both domain names in the server_name directive.

ng_inx_con

Finally, open ads.txt in the browser and if you can get the correct content, the issue should be solved soon.

Summary:

The reason Google AdSense warns about revenue loss risk and ads.txt issues is mainly because it cannot fetch the ads.txt file from the main domain bobobk.com. By troubleshooting the network requests step-by-step — CDN, web server (Nginx), etc. — and making sure the ads.txt file can be accessed from the main domain in a browser, the warning will stop appearing soon.