5 ms·
Best nginx config ever? location /dev/null { if ($request_method = POST ) { return 200; } }
by jnbiche 13y ago
Best nginx config ever?
location /dev/null {
if ($request_method = POST ) {
return 200;
}
}
- elwell 13y ago"200" makes sense. See wikipedia article on /dev/null[0]: "discards all data written to it but reports that the write operation succeeded." [0] - http://en.wikipedia.org/wiki//dev/null http://en.wikipedia.org/wiki//dev/null
- biot 13y agoShouldn't it return the status code "410 Gone"?
- bad_user 13y agoI think it should be "204 No Content".
- jgemedina 13y agoI second this one! makes more sense than plain 200.
- darkchasma 13y agoI can't believe you guys are debating the correct HTTP return code for a joke service? Besides, it's obviously 200.
- talles 13y agoWait... is it a joke?
- Daviey 13y agoI hope not, I've been depending on this service for a while. I have it integrated via FUSE on my prod servers. We did have some problems of blocking on large files, which is less than ideal for a /dev/null service. After dealing with their customer support (which has been super helpful), we are looking to move to a named pipe / FIFO.. Which will non-block and cache lolcally, with a watcher service to push it to their site. Happy Customer, A+++, would recommend.
- einhverfr 13y agoThese provide great opportunities for better understanding return codes. Besides, for POST it is obviously 202 ACCEPTED
- deleted 13y ago[deleted]
- general_failure 13y agoWell with the planned dev/random support, this is going to kick ass.
- Spooky23 13y agoDoes it discard data in a manner compliant with FIPS 140-2? Or NIST SP800-88?
- siddboots 13y ago200 for a POST, 204 for a GET.