I am trying to add the ads.txt to my website and trying to implement it with the command below however ->

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

I am getting this error:

Location command not found
allow command not found

Anybody experience this?

2 Replies

I don't use nginx but I'm pretty sure that the '=' is your problem. Change your config to:

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

See: https://bitlaunch.io/blog/how-to-configure-nginx/

While this syntax may (?) be correct, my advice does not guarantee that your site will suddenly start working.

-- sw

Hello, thank you for your suggestion. I tried it but it still provided the same outcome.


Please enter an answer

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct