← All platform guides

nginx / Apache

Place the file in your web root and set file permissions

Host app-ads.txt at your root domain

1

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.

2

Set file permissions so the web server process can read the file:

chmod 644 /var/www/html/app-ads.txt
3

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

1

Place robots.txt in the web root and add the following content:

User-agent: Google-adstxt
Allow: /app-ads.txt

User-agent: *
Disallow:
2

Set permissions:

chmod 644 /var/www/html/robots.txt
3

Verify at https://yourdomain.com/robots.txt.

Set up a 301 redirect (if needed)

1

For nginx, add a location block inside your server block:

location = /app-ads.txt {
  return 301 https://yourdomain.com$request_uri;
}
2

For Apache, add to your .htaccess or VirtualHost config:

RewriteEngine On
RewriteRule ^app-ads\.txt$ https://yourdomain.com/app-ads.txt [R=301,L]
3

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.

Run a free scan

Using a different platform? Browse all platform guides

nginx / Apache: app-ads.txt setup guide — AppAds Verify