I face funny problem: I have an FreeBSD 8.2 server, and I need to set up web server that wil answer zero (0) length answer to any request. Just '200 OK' and zero body.
Ok, I can setup nginx (and already did that) and set 404 error document to /dev/null, but I think maybe there is more optimal and elegant solution? I know there is nginx module that output 1x1 gif, may there be anything like that for zero-length file?
It's possible to return a status code from Nginx:
location /empty {
return 200;
}
NOTE Generally, HTTP status code 204 No Content is meant to say "I've completed the request, but there is no body to return". You may return it in the same fashion:
location /empty {
return 204;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With