Admins eHow SysAdmin Tips & Tricks

June 2, 2009

Force Download on nginx

Filed under: Nginx — Tags: , , — admin @ 9:05 pm

if you want force download on nginx for all files except images use the following config :

server{
	listen 80;
	server_name test.localhost;
	location / {
		root /Users/vasil/test;
		if ($request_filename !~* ^.*?\.(jpg)|(png)|(gif)){
			add_header Content-Disposition: "$request_filename";
		}
	}
}
  • Sunni Tinajero1

    It was great to stumble upon this post. I was searching for the same form some time ago and found a great service with a huge forms library. I am sure at least once in your life you had to fill out a form. I use a simple service http://goo.gl/VCg9ji for forms filling. It definitely makes my life easier!

Powered by WordPress