0

My root URL page is loaded via a call to render :stream => true, whereas all my other controllers render normally. When accessing the site via nginx, everything renders fine. When accessing via localhost (not going through nginx) I get no response. Using curl, I only get headers and the doctype declaration, but not anything that is supposed to be rendered through erb. Looking at my logs, I see that it gives the 'completed' message BEFORE rendering the templates.

Started GET "/" for 127.0.0.1 at 2013-10-03 21:40:31 -0400
Processing by HomeController#index as HTML
Completed 200 OK in 9ms (Views: 7.0ms | ActiveRecord: 0.0ms)
  Rendered shared/_meta_data.html.erb (1.0ms)
  Sitemap Load (1.0ms)  SELECT `sitemaps`.* FROM `sitemaps` ORDER BY name, action, controller
  Event Load (1.0ms)  SELECT `events`.* FROM `events` WHERE (YEAR(end_time) >= 2013) ORDER BY permanent, start_time, name
  Rendered shared/_navigation.html.erb (21.0ms)
  Rendered home/index.html.erb within layouts/application (335.0ms)


Started GET "/events" for 127.0.0.1 at 2013-10-03 21:40:47 -0400
Processing by EventsController#index as HTML
  Event Load (1.0ms)  SELECT `events`.* FROM `events` WHERE ('2013-10-03' BETWEEN DATE_ADD(start_time, INTERVAL -4 MONTH) AND end_time) ORDER BY start_time, name
  Rendered events/_event.html.erb (2.0ms)
  Rendered events/index.html.erb within layouts/application (4.0ms)
  Rendered shared/_meta_data.html.erb (1.0ms)
  Sitemap Load (3.0ms)  SELECT `sitemaps`.* FROM `sitemaps` ORDER BY name, action, controller
  Rendered shared/_navigation.html.erb (12.0ms)
Completed 200 OK in 355ms (Views: 348.0ms | ActiveRecord: 4.0ms)

So it's like it closes the connection before actually sending any real data. nginx has proxy buffer off.

I'm using Windows > nginx 1.3.14 > thin v1.5 > Rails v3.2.11 > Ruby v1.9.3p0

  • How are you running `curl` command – Viren Oct 04 '13 at 06:24
  • curl http://localhost:4200/ and curl -I http://localhost:4200/ for headers only. I set Rails routes to default to html as the request type. curl states that there are errors in the chunked response, but only after displaying the doctype declaration. – SnakeWasTheNameTheyGaveMe Oct 04 '13 at 12:49

0 Answers0