-->

Edi Santoso
Odoo and Python Developer
drink a tea to enjoying the life

Serve robots.txt in nginx with single line of code

To quickly serve a robots.txt from Nginx without actually having access to the physical file you can define the content of the robots.txt file in the Nginx .conf file.
Allow access to all User-agents:
location /robots.txt {return 200 "User-agent: *\nAllow: *\n";}
Disallow access to every User-agent:
location /robots.txt {return 200 "User-agent: *\nDisallow: /\n";}