How to force file download in the browser, nginx server

前端 未结 4 1417
误落风尘
误落风尘 2021-01-04 05:38

I currently have 2 image locations and they may the formats (jpg,jpeg,png,gif)

i.domain.com/simage.jpg thumbnail
i.domain.com/image.jpg high quality
i.domain         


        
4条回答
  •  孤独总比滥情好
    2021-01-04 06:13

    A little mixing did the job for me. Forced to download a CRX file instead of installing or displaying.

    ## Download crx
    location ~* \.crx$ {
        add_header Content-disposition "attachment; filename=$1";
    }
    

提交回复
热议问题