How To Enable Google Adsense ads.txt file for Drupal on Nginx

| Drupal Development | 65 seen

Around early September 2019, in my Google AdSense dashboard, I noticed a warning informing me to create a separate ads.txt file. 

I followed the on-screen instruction and did what was asked.

After two months (at the start of November) I noticed my earnings from Google AdSense have dipped more than half and the warning was still there. 

Earnings at risk - You need to fix some ads.txt file issues to avoid severe impact to your revenue.

Authorized Digital Sellers, or ads.txt is an IAB initiative that helps ensure that your digital ad inventory is only sold through sellers (such as AdSense) who you've identified as authorized. Creating your own ads.txt file gives you more control over who's allowed to sell ads on your site and helps prevent counterfeit inventory from being presented to advertisers.

We strongly recommend that you use an ads.txt file. It can help buyers identify counterfeit inventory and help you receive more advertiser spend that might have otherwise gone toward that counterfeit inventory.

I decided to check and huge was my surprise when trying to visit ads.txt file I got the following warning:

403 forbidden ads.txt file

403 forbidden ads.txt file

To solve it I changed the server file and added the following lines

location = /ads.txt {
allow all;
log_not_found off;
access_log off;
}

Problem solved

 

Latest articles

LEGOLAND Berlin Review: A Fun Family Activity in the German Capital

When planning a family trip to Berlin with children, most travelers immediately think about the Berlin Zoo — and rightly so. But if you are spending a few days in the German capital with younger kids, another solid half-day activity is the LEGOLAND Discovery Centre BerlinWe visited it in April 2026 together with our 7-year-old daughter during our…

Germany |

Ādģēri: The 30K Mistake That Turned Into a Long-Term Experiment

In 2023, we bought Ādģēri in an online auction.Price: just over €30,000.Financing: ~6% interest.Total expected payment over ~5 years: ~€40,000.Status (April 2026): more than half already paid.On paper, it was a bad deal.Realistically, we overpaid by at least 5–6× relative to what the property was objectively worth at the time. No serious buyer…

Ādģēri |