return 408 does not return body and status = 200
DeineAgentur
nginx-forum at nginx.us
Tue Feb 8 17:32:14 MSK 2011
Here my config:
[code]
location /expired.html {
return 408;
# root /var/www/dl_projekt/dl/htdocs;
}
location /bad_hash.html {
root /var/www/dl_projekt/dl/htdocs;
}
location / {
root /var/www/dl_projekt/dl/htdocs;
secure_download on;
secure_download_secret DontCopy;
secure_download_path_mode file;
if ($secure_download = "-1") {
return 408;
#rewrite ^(.*)$ /expired.html break;
}
if ($secure_download = "-2") {
return 401;
#rewrite ^(.*)$ /bad_hash.html break;
}
if ($secure_download = "-3") {
return 402;
}
if ($uri ~ "^/(.*)/[0-9a-zA-Z]*/[0-9a-zA-Z]*$") {
set $filename $1;
}
# Set appropriate headers
add_header Content-Disposition "attachment; filename=$filename";
rewrite ^(.*)/[0-9a-zA-Z]*/[0-9a-zA-Z]*$ $1 break;
}
[/code]
Posted at Nginx Forum: http://forum.nginx.org/read.php?2,173195,173214#msg-173214
More information about the nginx
mailing list