php-cgi/nginx returns http/0.9

Events happening in the community are now at Drupal community events on www.drupal.org.
404's picture

When I visit content type management page and try to delete a file field or a content type contains a file field, I get a page without any css or js. I can click submit but it doesn't work (it doesn't update or delete that field).

When I proxy the page to apache, the problem doesn't show up.

I use nginx-for-drupal conf at github. I didn't add or change anything.

I disabled all the third party modules and the problem still exist.

I run nginx 0.9.2, PHP 5.3.2-1ubuntu4.7 with Suhosin-Patch (cli) (built: Jan 12 2011 18:36:08), latest version of d7. [ php installed using apt on ubuntu]

I can't reproduce this every time, but I can consistently reproduce most of the time on all the sites running on the same server.

By looking at the http header of the page in question, I see nginx gives http/0.9 header. This is strange. According to nginx docs, this means the proxied backend responses with http/0.9. (which means php-cgi?)

Currently my solution is running these sites on apache. But I want to use nginx, the conf is much clearer and more elegant.

Attached is the http header:

http://example.com/admin/structure/types/manage/video-mysite/fields

GET /admin/structure/types/manage/video-mysite/fields HTTP/1.1

Host: example.com

User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.16) Gecko/20110323 Ubuntu/10.10 (maverick) Firefox/3.6.16

Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8

Accept-Language: zh-cn,zh;q=0.5

Accept-Encoding: gzip,deflate

Accept-Charset: UTF-8,*

Keep-Alive: 115

Connection: keep-alive

Cookie: __utma=27811563.1528010927.1301562472.1301562472.1301562472.1; __utmc=27811563; __utmz=27811563.1301562472.1.1.utmcsr=example.com|utmccn=(referral)|utmcmd=referral|utmcct=/; has_js=1; __utma=1.284278592.1301625348.1301625348.1301709294.2; __utmc=1; __utmz=1.1301625348.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); SESS78ad2310e3a5932bdeaea767548d24f9=HA-4y2oddbo2W976g0CuyWhZLmWDQ5pg2hsQVSLbIWI; Drupal.toolbar.collapsed=0; __utmb=1.1.10.1301709294

If-Modified-Since: Sat, 02 Apr 2011 02:00:14 +0000

If-None-Match: "1301709614"



HTTP/1.1 200 OK

Server: nginx

Date: Sat, 02 Apr 2011 02:01:15 GMT

Content-Type: text/html; charset=utf-8

Transfer-Encoding: chunked

Connection: keep-alive

Keep-Alive: timeout=10

Vary: Accept-Encoding

X-Powered-By: PHP/5.3.2-1ubuntu4.7

Expires: Sun, 19 Nov 1978 05:00:00 GMT

Last-Modified: Sat, 02 Apr 2011 02:01:14 +0000

Cache-Control: no-cache, must-revalidate, post-check=0, pre-check=0

Etag: "1301709674"

X-Generator: Drupal 7 (http://drupal.org)

Content-Encoding: gzip

----------------------------------------------------------

http://example.com/sites/example.com/files/css/css_5XB5aQOGzDUVxnwtHDXg0...



GET /sites/example.com/files/css/css_5XB5aQOGzDUVxnwtHDXg0AJDjmjZbe2Sh1K2BEkR5cM.css HTTP/1.1

Host: example.com

User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.16) Gecko/20110323 Ubuntu/10.10 (maverick) Firefox/3.6.16

Accept: text/css,*/*;q=0.1

Accept-Language: zh-cn,zh;q=0.5

Accept-Encoding: gzip,deflate

Accept-Charset: UTF-8,*

Keep-Alive: 115

Connection: keep-alive

Referer: http://example.com/admin/structure/types/manage/video-mysite/fields

Cookie: __utma=27811563.1528010927.1301562472.1301562472.1301562472.1; __utmc=27811563; __utmz=27811563.1301562472.1.1.utmcsr=example.com|utmccn=(referral)|utmcmd=referral|utmcct=/; has_js=1; __utma=1.284278592.1301625348.1301625348.1301709294.2; __utmc=1; __utmz=1.1301625348.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); SESS78ad2310e3a5932bdeaea767548d24f9=HA-4y2oddbo2W976g0CuyWhZLmWDQ5pg2hsQVSLbIWI; Drupal.toolbar.collapsed=0; __utmb=1.1.10.1301709294



HTTP/0.9 200 OK

----------------------------------------------------------

http://example.com/sites/example.com/files/css/css_XZdypg1bvyOKlXIsQuDLP...



GET /sites/example.com/files/css/css_XZdypg1bvyOKlXIsQuDLPfaa58Y0fVTK-GE7Ys70yCI.css HTTP/1.1

Host: example.com

User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.16) Gecko/20110323 Ubuntu/10.10 (maverick) Firefox/3.6.16

Accept: text/css,*/*;q=0.1

Accept-Language: zh-cn,zh;q=0.5

Accept-Encoding: gzip,deflate

Accept-Charset: UTF-8,*

Keep-Alive: 115

Connection: keep-alive

Referer: http://example.com/admin/structure/types/manage/video-mysite/fields

Cookie: __utma=27811563.1528010927.1301562472.1301562472.1301562472.1; __utmc=27811563; __utmz=27811563.1301562472.1.1.utmcsr=example.com|utmccn=(referral)|utmcmd=referral|utmcct=/; has_js=1; __utma=1.284278592.1301625348.1301625348.1301709294.2; __utmc=1; __utmz=1.1301625348.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); SESS78ad2310e3a5932bdeaea767548d24f9=HA-4y2oddbo2W976g0CuyWhZLmWDQ5pg2hsQVSLbIWI; Drupal.toolbar.collapsed=0; __utmb=1.1.10.1301709294



HTTP/0.9 200 OK

----------------------------------------------------------

http://example.com/sites/example.com/files/css/css_Uy1aIiY1PHMsh853qG8Yf...



GET /sites/example.com/files/css/css_Uy1aIiY1PHMsh853qG8YfRmd1TllwBJNDYTVg0idYHk.css HTTP/1.1

Host: example.com

User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.16) Gecko/20110323 Ubuntu/10.10 (maverick) Firefox/3.6.16

Accept: text/css,*/*;q=0.1

Accept-Language: zh-cn,zh;q=0.5

Accept-Encoding: gzip,deflate

Accept-Charset: UTF-8,*

Keep-Alive: 115

Connection: keep-alive

Referer: http://example.com/admin/structure/types/manage/video-mysite/fields

Cookie: __utma=27811563.1528010927.1301562472.1301562472.1301562472.1; __utmc=27811563; __utmz=27811563.1301562472.1.1.utmcsr=example.com|utmccn=(referral)|utmcmd=referral|utmcct=/; has_js=1; __utma=1.284278592.1301625348.1301625348.1301709294.2; __utmc=1; __utmz=1.1301625348.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); SESS78ad2310e3a5932bdeaea767548d24f9=HA-4y2oddbo2W976g0CuyWhZLmWDQ5pg2hsQVSLbIWI; Drupal.toolbar.collapsed=0; __utmb=1.1.10.1301709294



HTTP/0.9 200 OK

----------------------------------------------------------

http://example.com/sites/example.com/files/css/css_ORFuU5HyRPdWE0aj1ctqn...



GET /sites/example.com/files/css/css_ORFuU5HyRPdWE0aj1ctqn8t1ZFIb0M0VciOarO4j658.css HTTP/1.1

Host: example.com

User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.16) Gecko/20110323 Ubuntu/10.10 (maverick) Firefox/3.6.16

Accept: text/css,*/*;q=0.1

Accept-Language: zh-cn,zh;q=0.5

Accept-Encoding: gzip,deflate

Accept-Charset: UTF-8,*

Keep-Alive: 115

Connection: keep-alive

Referer: http://example.com/admin/structure/types/manage/video-mysite/fields

Cookie: __utma=27811563.1528010927.1301562472.1301562472.1301562472.1; __utmc=27811563; __utmz=27811563.1301562472.1.1.utmcsr=example.com|utmccn=(referral)|utmcmd=referral|utmcct=/; has_js=1; __utma=1.284278592.1301625348.1301625348.1301709294.2; __utmc=1; __utmz=1.1301625348.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); SESS78ad2310e3a5932bdeaea767548d24f9=HA-4y2oddbo2W976g0CuyWhZLmWDQ5pg2hsQVSLbIWI; Drupal.toolbar.collapsed=0; __utmb=1.1.10.1301709294



HTTP/0.9 200 OK

----------------------------------------------------------

http://example.com/sites/example.com/files/css/css_8Z9FRJXd9GYsqvvPuwyZZ...



GET /sites/example.com/files/css/css_8Z9FRJXd9GYsqvvPuwyZZv53W_U3nuBk4g4ktsbMI5E.css HTTP/1.1

Host: example.com

User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.16) Gecko/20110323 Ubuntu/10.10 (maverick) Firefox/3.6.16

Accept: text/css,*/*;q=0.1

Accept-Language: zh-cn,zh;q=0.5

Accept-Encoding: gzip,deflate

Accept-Charset: UTF-8,*

Keep-Alive: 115

Connection: keep-alive

Referer: http://example.com/admin/structure/types/manage/video-mysite/fields

Cookie: __utma=27811563.1528010927.1301562472.1301562472.1301562472.1; __utmc=27811563; __utmz=27811563.1301562472.1.1.utmcsr=example.com|utmccn=(referral)|utmcmd=referral|utmcct=/; has_js=1; __utma=1.284278592.1301625348.1301625348.1301709294.2; __utmc=1; __utmz=1.1301625348.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); SESS78ad2310e3a5932bdeaea767548d24f9=HA-4y2oddbo2W976g0CuyWhZLmWDQ5pg2hsQVSLbIWI; Drupal.toolbar.collapsed=0; __utmb=1.1.10.1301709294



HTTP/0.9 200 OK

----------------------------------------------------------

http://example.com/sites/example.com/files/js/js_3Nqm4uVaWHk6z2YABPJylxL...



GET /sites/example.com/files/js/js_3Nqm4uVaWHk6z2YABPJylxLJMtYGTVNu9_nRrU-_6CY.js HTTP/1.1

Host: example.com

User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.16) Gecko/20110323 Ubuntu/10.10 (maverick) Firefox/3.6.16

Accept: */*

Accept-Language: zh-cn,zh;q=0.5

Accept-Encoding: gzip,deflate

Accept-Charset: UTF-8,*

Keep-Alive: 115

Connection: keep-alive

Referer: http://example.com/admin/structure/types/manage/video-mysite/fields

Cookie: __utma=27811563.1528010927.1301562472.1301562472.1301562472.1; __utmc=27811563; __utmz=27811563.1301562472.1.1.utmcsr=example.com|utmccn=(referral)|utmcmd=referral|utmcct=/; has_js=1; __utma=1.284278592.1301625348.1301625348.1301709294.2; __utmc=1; __utmz=1.1301625348.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); SESS78ad2310e3a5932bdeaea767548d24f9=HA-4y2oddbo2W976g0CuyWhZLmWDQ5pg2hsQVSLbIWI; Drupal.toolbar.collapsed=0; __utmb=1.1.10.1301709294



HTTP/0.9 200 OK

----------------------------------------------------------

http://example.com/sites/example.com/files/js/js_pvd4dv44KjM-iRgTz7iAr7P...



GET /sites/example.com/files/js/js_pvd4dv44KjM-iRgTz7iAr7PCD1sMCcrVLL3JuNcpwl4.js HTTP/1.1

Host: example.com

User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.16) Gecko/20110323 Ubuntu/10.10 (maverick) Firefox/3.6.16

Accept: */*

Accept-Language: zh-cn,zh;q=0.5

Accept-Encoding: gzip,deflate

Accept-Charset: UTF-8,*

Keep-Alive: 115

Connection: keep-alive

Referer: http://example.com/admin/structure/types/manage/video-mysite/fields

Cookie: __utma=27811563.1528010927.1301562472.1301562472.1301562472.1; __utmc=27811563; __utmz=27811563.1301562472.1.1.utmcsr=example.com|utmccn=(referral)|utmcmd=referral|utmcct=/; has_js=1; __utma=1.284278592.1301625348.1301625348.1301709294.2; __utmc=1; __utmz=1.1301625348.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); SESS78ad2310e3a5932bdeaea767548d24f9=HA-4y2oddbo2W976g0CuyWhZLmWDQ5pg2hsQVSLbIWI; Drupal.toolbar.collapsed=0; __utmb=1.1.10.1301709294



HTTP/0.9 200 OK

Comments

How are you running

perusio's picture

the CGI? php-cgi? php-fpm? Try disabling the JS and CSS aggregation to see if it fixes the missing CSS and JS files.

Could it be the timeout settings?

Also you can try setting tcp_nodelay to off so that it doesn't bleed updates for static files.

@perusio I am using

404's picture

@perusio

I am using php-cgi

fastcgi.conf:## allow 4 hrs - pass timeout responsibility to upstrea
fastcgi.conf:fastcgi_read_timeout 14400;

I turned tcp_nodely to off, didn't work

The problem persists even when regular user try to create a node containing a file upload field. So I have to proxy all requests to apache instead of only the /admin/content-type/ part.

This problem is so peculiar that I am ready to give up. I will migrate these sites to a new server in a few month. Hope things will just magically turn out right.

Check the logs

perusio's picture

Enable the debug flag on the error_log directive. And check the output. Note that is huge. Better paste it at some pastebin service :)

advagg

mikeytown2's picture

If you wouldn't mind testing out my module to see if it fixes the missing CSS/JS issues you might be encountering.
http://drupal.org/project/advagg
Either wait an hour for the latest dev to get generated or try the latest snapshot.
http://drupalcode.org/project/advagg.git/snapshot/4bf633a98ae3d34de50cdf...

Need a nginx setup doc: http://drupal.org/node/1116618

Hi Mikey, advagg doesn't have

404's picture

Hi Mikey, advagg doesn't have a d7 port yet. Hope boost d7 port will have things like that by default, will it? :)

I think the missing of css/js is caused by misconfiguration on my server rather than nginx rules or any drupal module. Since there isn't anyone else having the same issue.

Problem solved. I am using

404's picture

Problem solved.

I am using perusio's nginx conf. Because my content-type has a field named upload_video, the word "video" triggers the blacklist.conf.

I just delete the keyword video in blacklist.conf, and everything is fine. Smooth!

Thanks for cannod who found this issue: http://groups.drupal.org/node/141759

Nginx

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

Hot content this week