0

Got a static zip file which I want to allow users to download it when they refer to the right path (In the URL). My thought was to do it with a regular 'location' endpoint that will use the the 'try_files' option which will point to the real location of the file.

location /featurename/windows/application {
  # disable cache
  add_header Cache-Control 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0';
  # internal redirect to download file
  try_files  /featurename/featurepath/application.zip @default;
}

The problem with the above solution is that it always set the file name as the last word in the URL path. For example, if the url endpoint referring to '/featurename/windows/application', a file named 'application.zip' will be downloaded. If sometime I'll decide that I want to change the location endpoint to '/featurename/application/windows', the downloaded file will be called automatically windows.zip (it will be left with the right content) and that's a problem.

Is it possible to set a static name to the downloaded file?

Thanks!!!

GalRosen
  • 1
  • 3

0 Answers0