I have 2 RoR web applications hosted on 2 different servers. For one particular page, the request is served from the second application. For rest of the pages, the request is served from the main application. Nginx settings for the main application
location /customer/help/ {
proxy_pass http://second-application:3020/help_and_support/;
}
location /assets/ {
proxy_pass http://second-application:3020/assets/;
}
This worked fine until yesterday. Now, /customer/help/
page is not loading properly. In firefox it shows a blank page, in chrome, it loads partially and console shows an error
net::ERR_INCOMPLETE_CHUNKED_ENCODING
After debugging I found that issue might be with image data sent over API. My second app calls an API to get images and displays them on page
<% url_with_binary_data = "data:image/" + "jpeg" + ";base64," + u.photo_url.to_s %>
<%= image_tag(url_with_binary_data, :class => "userpic") %>
API code to get the image
photo_url: Base64.encode64(u.photo.file.read).gsub("\n", '')