Nginx has a root folder let's say /var/www/mysite1/
I have a file in /var/www/ that I need to be able to serve. This file sometime exists, sometime does not. If the file is not there, by default nginx is returning a 404. How can I set up a different response code, or a 301 redirection ?
location /myfile.txt {
alias /var/www/myfile.txt;
}