This section expands our ads.txt setup article to cover steps on setting up a 301 redirect for Nginx web servers.

  • Locate your Nginx site configuration.On Unix this is commonly in /etc/nginx/conf/sites-enabledOn Windows look for the conf directory in the directory nginx was installed

  • Open the configuration file for your website.

  • Add the following line in the file, replace #### with the ID of your property, found in your site list in the NitroPay panel.

rewrite ^/ads.txt$ permanent;
  • For example, this might look like:

server {
    . . .

    rewrite ^/ads.txt$ permanent;
    . . .
  • Save the file and restart nginx.

  • Test that the redirect works by going to and noting that the URL and contents changed to the hosted ads.txt.

Did this answer your question?