nginx inserting extra characters in Multi-status reply body

Posted by user125011 on Server Fault See other posts from Server Fault or by user125011
Published on 2012-06-18T00:26:10Z Indexed on 2012/06/18 3:17 UTC
Read the original article Hit count: 497

Filed under:
|
|

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?

© Server Fault or respective owner

Related posts about nginx

Related posts about reverse-proxy