It's not too well documented, but it's possible to serve content directly from memory:
# No indexing
location = /robots.txt {
return 200 "User-agent: *\r\nDisallow: /\r\n";
}
The snippet above serves a deny-all
robots.txt
'file' directly from memory.
Also bear in mind that this configuration overrides any file that actually exists on disk.
Continue reading Serve Content From Memory With Nginx.