You need to use the Content-Disposition HTTP header to speficy filename different from xyz:

location = /xyz {
    alias /path/abc.tst;
    add_header Content-Disposition 'attachment; filename="abc.tst"';
}

You may also need to specify MIME type for this file, use default_type directive, for generic binary data try

default_type application/octet-stream;

answered May 20, 2021 at 21:18

Ivan Shatsky's user avatar

Ivan ShatskyIvan Shatsky

15.8k2 gold badges25 silver badges51 bronze badges

3

Sign up or log in

Sign up using Email and Password

Post as a guest

Required, but never shown