2

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;
    server_name  cloud.mydomain.com;

    location / {
        proxy_set_header X-Forwarded-Host cloud.mydomain.com;
        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?

Jason E
  • 123
  • 1
  • 3

1 Answers1

1

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;
mgorven
  • 30,615
  • 7
  • 79
  • 122