Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Here's the setup. I've got one server running apache/php hosting ownCloud. Among other things, I'm using to do CardDAV contact syncing. In order to make things work with my domain I have an nginx server running on the frontend as a reverse-proxy to the ownCloud server. My nginx config is as follows:

server {
    listen       80;

    location / {
        proxy_set_header X-Forwarded-Host;
        proxy_set_header X-Forwarded-Proto http;
        proxy_set_header X-Forwarded-For $remote_addr;
        client_max_body_size 0;
        proxy_redirect off;
        proxy_pass      http://server;

The problem is that when my phone does a PROPFIND on the server, nginx adds extra characters to the content body that throw the phone off. Specifically, it prepends d611\r\n at the front of the body and appends 0\r\n\r\n to the end of the content. (I got this from wireshark.) It also re-chunks the result. How do I get nginx to send the original content as-is?

share|improve this question
up vote 1 down vote accepted

The additional characters you are seeing is the chunked transfer encoding format. The number is the length of the chunk, and the \r\n's are delimiters. It seems that the phone does not support chunked transfer encoding (although if it declares that it supports HTTP 1.1 it is supposed to). You can disable chunked transfer encoding with the chunked_transfer_encoding directive.

chunked_transfer_encoding off;
share|improve this answer
Thanks, that seems to have worked. – Jason E Jun 18 '12 at 15:35

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.