On my website, I did caching data with memcached. It stores fully generated html pages. The next step was to get this data from memcached from nginx and send it back to the user w \ o start apache. At first I tried to get data from the cache using php backend and it worked. But when I try to do this with nginx - I see barely corrupted data. smth like 
I ask for help with this problem.
ps here is part of nginx configuration if it can help
location / { #add_header Content-Type "text/html"; set $cachable 1; if ($request_method = POST){ set $cachable 0; break; } if ($http_cookie ~ "beauty_logged") { set $cachable 0; break; } if ($cachable = 1) { set $memcached_key 'nginx_$host$uri'; memcached_pass 127.0.0.1:11211; } default_type text/html; error_page 404 502 504 405 = @php; #proxy_pass http://front_cluster; } location @php { proxy_pass http://front_cluster; }
source share