Host app-ads.txt at your root domain
Upload app-ads.txt to your server's web root directory. For nginx this is typically /var/www/html/ or /var/www/yourdomain.com/public_html/. For Apache it is typically the DocumentRoot configured in your VirtualHost.
Set file permissions so the web server process can read the file:
chmod 644 /var/www/html/app-ads.txt
Verify at https://yourdomain.com/app-ads.txt. No server config changes are needed; both nginx and Apache serve static files in the web root automatically.
Note: Some server security configurations (ModSecurity, SELinux file contexts, or custom nginx deny rules for .txt files) may block access. If the file returns 403 Forbidden, check your security module logs and adjust the relevant rule.
Allow the Google-adstxt crawler in robots.txt
Place robots.txt in the web root and add the following content:
User-agent: Google-adstxt Allow: /app-ads.txt User-agent: * Disallow:
Set permissions:
chmod 644 /var/www/html/robots.txt
Verify at https://yourdomain.com/robots.txt.
Set up a 301 redirect (if needed)
For nginx, add a location block inside your server block:
location = /app-ads.txt {
return 301 https://yourdomain.com$request_uri;
}For Apache, add to your .htaccess or VirtualHost config:
RewriteEngine On RewriteRule ^app-ads\.txt$ https://yourdomain.com/app-ads.txt [R=301,L]
Reload the server configuration:
# nginx nginx -t && systemctl reload nginx # Apache apachectl configtest && systemctl reload apache2
Done setting up?
Run a free scan to confirm your app-ads.txt is reachable and correctly configured.
Using a different platform? Browse all platform guides