I have folders and files that are structured like this:

-root/111/content.csv -root/112/content.csv -root/113/content.csv -root/114/content.csv 

When I request a type of http://someurl/download/111 I want to return the content.cvs file from the 111 folder. How can I properly fix such a bogus configuration:

 server { listen 80; location /download/ { alias /home/root/111/conent.csv; } } 

?

  • 2
    index prescribe content.cvs? - ilyaplot
  • How to do it?) - faoxis

1 answer 1

You can use the rewrite directive:

 server { listen 80; location /download/ { root /home/root/; rewrite /download/(.*)$ /$1/content.cvs break; } } 
  • why, there is try_files - etki