# Return 408 does not return body and status = 200

**URL:** <https://www.ruby-forum.com/t/return-408-does-not-return-body-and-status-200/202889>\
**Category:** NGINX\
**Created:** [February 8, 2011, 3:03pm UTC](https://www.ruby-forum.com/t/return-408-does-not-return-body-and-status-200/202889 "2011-02-08T15:03:45Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [February 8, 2011, 3:03pm UTC](https://www.ruby-forum.com/t/return-408-does-not-return-body-and-status-200/202889/1 "2011-02-08T15:03:45Z")

</div>

Hello!

If i set

```auto
return 408;
```

there is no return status 408 and no body response.

Posted at Nginx Forum:

> **[return 408 does not return body and status = 200](https://forum.nginx.org/read.php?2,173195,173195#msg-173195)**
>
> Hello! If i set \[code\] return 408; \[/code\] there is no return status 408 and no body response.

---

<div class="post-metadata">

**Author:** ![DeineAgentur](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/e56c9b/32.png) [@DeineAgentur](https://www.ruby-forum.com/u/DeineAgentur)\
**Post date:** [February 8, 2011, 3:30pm UTC](https://www.ruby-forum.com/t/return-408-does-not-return-body-and-status-200/202889/2 "2011-02-08T15:30:08Z")

</div>

```auto
2011/02/08 15:05:11 [debug] 25004#0: *3 event timer del: 56:
1297173971541
2011/02/08 15:05:11 [debug] 25004#0: *3 rewrite phase: 0
2011/02/08 15:05:11 [debug] 25004#0: *3 test location: "/"
2011/02/08 15:05:11 [debug] 25004#0: *3 test location: "expired.html"
2011/02/08 15:05:11 [debug] 25004#0: *3 test location: "bad_hash.html"
2011/02/08 15:05:11 [debug] 25004#0: *3 using configuration "/"
2011/02/08 15:05:11 [debug] 25004#0: *3 http cl:-1 max:1048576
2011/02/08 15:05:11 [debug] 25004#0: *3 rewrite phase: 2
2011/02/08 15:05:11 [debug] 25004#0: *3 http script var
2011/02/08 15:05:11 [debug] 25004#0: *3 expired timestamp
2011/02/08 15:05:11 [debug] 25004#0: *3 http script var: "-1"
2011/02/08 15:05:11 [debug] 25004#0: *3 http script value: "-1"
2011/02/08 15:05:11 [debug] 25004#0: *3 http script equal
2011/02/08 15:05:11 [debug] 25004#0: *3 http script if
2011/02/08 15:05:11 [debug] 25004#0: *3 http finalize request: 408,
"/A_134_2.zip/fa90d996636b0a27eced337b08cec6c8/4d505737?" a:1, c:1
2011/02/08 15:05:11 [debug] 25004#0: *3 http terminate request count:1
2011/02/08 15:05:11 [debug] 25004#0: *3 http terminate cleanup count:1
blk:0
2011/02/08 15:05:11 [debug] 25004#0: *3 http posted request:
"/A_134_2.zip/fa90d996636b0a27eced337b08cec6c8/4d505737?"
2011/02/08 15:05:11 [debug] 25004#0: *3 http terminate handler count:1
2011/02/08 15:05:11 [debug] 25004#0: *3 http request count:1 blk:0
2011/02/08 15:05:11 [debug] 25004#0: *3 http close request
2011/02/08 15:05:11 [debug] 25004#0: *3 http log handler
2011/02/08 15:05:11 [debug] 25004#0: *3 free: 00000000006D2730, unused:
726
2011/02/08 15:05:11 [debug] 25004#0: *3 close http connection: 56
2011/02/08 15:05:11 [debug] 25004#0: *3 free: 000000000074CAC0
2011/02/08 15:05:11 [debug] 25004#0: *3 free: 000000000074C5B0
2011/02/08 15:05:11 [debug] 25004#0: *3 free: 00000000007D09C0, unused:
8
2011/02/08 15:05:11 [debug] 25004#0: *3 free: 00000000007D0450, unused:
128
2011/02/08 15:05:11 [debug] 25004#0: *4 event timer del: 56:
1297173971825
2011/02/08 15:05:11 [debug] 25004#0: *4 rewrite phase: 0
2011/02/08 15:05:11 [debug] 25004#0: *4 test location: "/"
2011/02/08 15:05:11 [debug] 25004#0: *4 test location: "expired.html"
2011/02/08 15:05:11 [debug] 25004#0: *4 test location: "bad_hash.html"
2011/02/08 15:05:11 [debug] 25004#0: *4 using configuration "/"
2011/02/08 15:05:11 [debug] 25004#0: *4 http cl:-1 max:1048576
2011/02/08 15:05:11 [debug] 25004#0: *4 rewrite phase: 2
2011/02/08 15:05:11 [debug] 25004#0: *4 http script var
2011/02/08 15:05:11 [debug] 25004#0: *4 expired timestamp
2011/02/08 15:05:11 [debug] 25004#0: *4 http script var: "-1"
2011/02/08 15:05:11 [debug] 25004#0: *4 http script value: "-1"
2011/02/08 15:05:11 [debug] 25004#0: *4 http script equal
2011/02/08 15:05:11 [debug] 25004#0: *4 http script if
2011/02/08 15:05:11 [debug] 25004#0: *4 http finalize request: 408,
"/A_134_2.zip/fa90d996636b0a27eced337b08cec6c8/4d505737?" a:1, c:1
2011/02/08 15:05:11 [debug] 25004#0: *4 http terminate request count:1
2011/02/08 15:05:11 [debug] 25004#0: *4 http terminate cleanup count:1
blk:0
2011/02/08 15:05:11 [debug] 25004#0: *4 http posted request:
"/A_134_2.zip/fa90d996636b0a27eced337b08cec6c8/4d505737?"
2011/02/08 15:05:11 [debug] 25004#0: *4 http terminate handler count:1
2011/02/08 15:05:11 [debug] 25004#0: *4 http request count:1 blk:0
2011/02/08 15:05:11 [debug] 25004#0: *4 http close request
2011/02/08 15:05:11 [debug] 25004#0: *4 http log handler
2011/02/08 15:05:11 [debug] 25004#0: *4 free: 00000000006D2730, unused:
726
2011/02/08 15:05:11 [debug] 25004#0: *4 close http connection: 56
2011/02/08 15:05:11 [debug] 25004#0: *4 free: 000000000074CAC0
2011/02/08 15:05:11 [debug] 25004#0: *4 free: 000000000074C5B0
2011/02/08 15:05:11 [debug] 25004#0: *4 free: 00000000007D09C0, unused:
8
2011/02/08 15:05:11 [debug] 25004#0: *4 free: 00000000007D0450, unused:
128
2011/02/08 15:38:22 [debug] 25004#0: *658 event timer del: 60:
1297175962966

```

Posted at Nginx Forum:

> **[Re: return 408 does not return body and status = 200](https://forum.nginx.org/read.php?2,173195,173209#msg-173209)**
>
> Hello! If i set \[code\] return 408; \[/code\] there is no return status 408 and no body response.

---

<div class="post-metadata">

**Author:** ![DeineAgentur](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/e56c9b/32.png) [@DeineAgentur](https://www.ruby-forum.com/u/DeineAgentur)\
**Post date:** [February 8, 2011, 3:32pm UTC](https://www.ruby-forum.com/t/return-408-does-not-return-body-and-status-200/202889/3 "2011-02-08T15:32:02Z")

</div>

```auto
2011/02/08 15:41:24 [debug] 25270#0: *3 event timer del: 56:
1297176144249
2011/02/08 15:41:24 [debug] 25270#0: *3 rewrite phase: 0
2011/02/08 15:41:24 [debug] 25270#0: *3 test location: "/"
2011/02/08 15:41:24 [debug] 25270#0: *3 test location: "expired.html"
2011/02/08 15:41:24 [debug] 25270#0: *3 using configuration
"/expired.html"
2011/02/08 15:41:24 [debug] 25270#0: *3 http cl:-1 max:1048576
2011/02/08 15:41:24 [debug] 25270#0: *3 rewrite phase: 2
2011/02/08 15:41:24 [debug] 25270#0: *3 http finalize request: 408,
"/expired.html?" a:1, c:1
2011/02/08 15:41:24 [debug] 25270#0: *3 http terminate request count:1
2011/02/08 15:41:24 [debug] 25270#0: *3 http terminate cleanup count:1
blk:0
2011/02/08 15:41:24 [debug] 25270#0: *3 http posted request:
"/expired.html?"
2011/02/08 15:41:24 [debug] 25270#0: *3 http terminate handler count:1
2011/02/08 15:41:24 [debug] 25270#0: *3 http request count:1 blk:0
2011/02/08 15:41:24 [debug] 25270#0: *3 http close request
2011/02/08 15:41:24 [debug] 25270#0: *3 http log handler
2011/02/08 15:41:24 [debug] 25270#0: *3 free: 00000000006D2730, unused:
728
2011/02/08 15:41:24 [debug] 25270#0: *3 close http connection: 56
2011/02/08 15:41:24 [debug] 25270#0: *3 free: 000000000074CAC0
2011/02/08 15:41:24 [debug] 25270#0: *3 free: 000000000074C5B0
2011/02/08 15:41:24 [debug] 25270#0: *3 free: 00000000007CFF70, unused:
8
2011/02/08 15:41:24 [debug] 25270#0: *3 free: 00000000007D09C0, unused:
128
2011/02/08 15:41:24 [debug] 25270#0: *4 event timer del: 56:
1297176144782
2011/02/08 15:41:24 [debug] 25270#0: *4 rewrite phase: 0
2011/02/08 15:41:24 [debug] 25270#0: *4 test location: "/"
2011/02/08 15:41:24 [debug] 25270#0: *4 test location: "expired.html"
2011/02/08 15:41:24 [debug] 25270#0: *4 using configuration
"/expired.html"
2011/02/08 15:41:24 [debug] 25270#0: *4 http cl:-1 max:1048576
2011/02/08 15:41:24 [debug] 25270#0: *4 rewrite phase: 2
2011/02/08 15:41:24 [debug] 25270#0: *4 http finalize request: 408,
"/expired.html?" a:1, c:1
2011/02/08 15:41:24 [debug] 25270#0: *4 http terminate request count:1
2011/02/08 15:41:24 [debug] 25270#0: *4 http terminate cleanup count:1
blk:0
2011/02/08 15:41:24 [debug] 25270#0: *4 http posted request:
"/expired.html?"
2011/02/08 15:41:24 [debug] 25270#0: *4 http terminate handler count:1
2011/02/08 15:41:24 [debug] 25270#0: *4 http request count:1 blk:0
2011/02/08 15:41:24 [debug] 25270#0: *4 http close request
2011/02/08 15:41:24 [debug] 25270#0: *4 http log handler
2011/02/08 15:41:24 [debug] 25270#0: *4 free: 00000000006D2730, unused:
728
2011/02/08 15:41:24 [debug] 25270#0: *4 close http connection: 56
2011/02/08 15:41:24 [debug] 25270#0: *4 free: 000000000074CAC0
2011/02/08 15:41:24 [debug] 25270#0: *4 free: 000000000074C5B0
2011/02/08 15:41:24 [debug] 25270#0: *4 free: 00000000007CFF70, unused:
8
2011/02/08 15:41:24 [debug] 25270#0: *4 free: 00000000007D09C0, unused:
128
```

Posted at Nginx Forum:

> **[Re: return 408 does not return body and status = 200](https://forum.nginx.org/read.php?2,173195,173213#msg-173213)**
>
> Hello! If i set \[code\] return 408; \[/code\] there is no return status 408 and no body response.

---

<div class="post-metadata">

**Author:** ![DeineAgentur](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/e56c9b/32.png) [@DeineAgentur](https://www.ruby-forum.com/u/DeineAgentur)\
**Post date:** [February 8, 2011, 4:26pm UTC](https://www.ruby-forum.com/t/return-408-does-not-return-body-and-status-200/202889/4 "2011-02-08T16:26:05Z")

</div>

Hello!

On Tue, Feb 08, 2011 at 09:02:30AM -0500, DeineAgentur wrote:

> Hello!
> 
> If i set
> 
> ```auto
> return 408;
> ```
> 
> there is no return status 408 and no body response.

Yes, it’s expected. Code 408 is expected to be generated when  
client timed out and we aren’t willing to wait anymore, it causes  
immediate request (and connection) close.

Maxim D.

---

<div class="post-metadata">

**Author:** ![DeineAgentur](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/e56c9b/32.png) [@DeineAgentur](https://www.ruby-forum.com/u/DeineAgentur)\
**Post date:** [February 8, 2011, 3:33pm UTC](https://www.ruby-forum.com/t/return-408-does-not-return-body-and-status-200/202889/5 "2011-02-08T15:33:56Z")

</div>

Here my config:

```auto
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;
  }
```

Posted at Nginx Forum:

> **[Re: return 408 does not return body and status = 200](https://forum.nginx.org/read.php?2,173195,173214#msg-173214)**
>
> Hello! If i set \[code\] return 408; \[/code\] there is no return status 408 and no body response.

---

<div class="post-metadata">

**Author:** ![DeineAgentur](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/e56c9b/32.png) [@DeineAgentur](https://www.ruby-forum.com/u/DeineAgentur)\
**Post date:** [February 8, 2011, 5:48pm UTC](https://www.ruby-forum.com/t/return-408-does-not-return-body-and-status-200/202889/6 "2011-02-08T17:48:32Z")

</div>

Hi Maxim,

sure it is! But if the time between 2 requests for authentication too  
large is a 408 code should be thrown.

When this code is issued, it should not be Returned with code 200, but  
that happened here.

Otherwise, the client does not understand what’s going on. Sure, we  
could also have a code 503, but based on the “edit log” is a code 408 is  
required.

Other webservers do response also the code 408 and a body.

Posted at Nginx Forum:

> **[Re: return 408 does not return body and status = 200](https://forum.nginx.org/read.php?2,173195,173265#msg-173265)**
>
> Hello! If i set \[code\] return 408; \[/code\] there is no return status 408 and no body response.
