I want Nginx to return r.json file for path example.com/r/ What I tried:
location /r/ {
alias /home/user/media/json/r.json;
}
But all that didn't work. I've got 500 with message:
/home/user/media/json/r.jsonindex.html is not a directory
location = /r/ {
try_files r.json =404;
}
Use the index
directive to name r.json
as the default filename within that location:
location /r/ {
index r.json;
alias /home/user/media/json/;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With