Closed (fixed)
Project:
Drupal core
Version:
6.14
Component:
base system
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
6 Jan 2009 at 20:00 UTC
Updated:
8 Mar 2012 at 18:20 UTC
Jump to comment: Most recent file
Comments
Comment #1
ryan_courtnage commentedI should mention that this problem is specific to being behind the reverse-proxy, which will set some $_SERVER variables that Drupal will use (ie: HTTP_X_FORWARDED_FOR).
In settings.php, the reverse proxy settings are set:
'reverse_proxy' => TRUE,
'reverse_proxy_addresses' => array('192.168.1.42'),
Comment #2
chrsc commentedWere you able to fix it? I'm having the same problem, only with a custom template.
Comment #3
ryan_courtnage commentedHi,
Sorry, I never did solve this problem. It only happens in our staging environment, which is using nginx as the reverse proxy. On our production server we use a different proxy, and the problem doesn't appear.
Comment #4
seanubis commentedThis isn't a problem with the Zen theme. This problem appears to be due to the fact that when Drupal sets a 404 or 403 header (in includes/common.inc) it's specifying HTTP/1.1 as the server protocol, eg:
This is a problem because apparently Nginx can only speak HTTP/1.0 to backend servers.
You can work around the problem by modifying the drupal_set_header function as follows:
Comment #5
jslag commentedThanks for the explanation -- I'm seeing this as well on my site, also being proxied by nginx.
If I'm understanding things correctly, it looks like this code path has been redone in D7.
Would it be possible to do something about this for D6 sites via a module? I've just done some digging around but I don't see if it'd be possible.
Comment #6
Jānis Bebrītis commentedSorry for bumping into old thread, we moved to nginx frontend for some VPS`es too and ran into the same problem. I googled around and found solution to alter apache2 configuration so that it forces HTTP 1.0 headers.
I added following two lines at the end of /etc/apache2/apache2.conf
SetEnv force-response-1.0 1
SetEnv downgrade-1.0 1
This works for nginx proxy as frontend and apache as backend. I hope it helps someone.
Solution found on http://brainstorm.name/blog/nginx-apache-proxy-chunked-encoding-problem.... which is pointing to http://www.lexa.ru/nginx-ru/msg25234.html
Comment #7
Jānis Bebrītis commentedComment #8
geerlingguy commentedI'm having the same problem on two different sites. This was puzzling the heck out of me... and it only appears to the end user in Internet Explorer (the characters show up before the opening tag). Consider this a subscribe :-/
Comment #9
damienmckennaHere's a quick patch to implement the code listed in #4 above.
Comment #10
yang_yi_cn commentedsubscribe
Comment #11
emackn commented#6 worked for us. :) Only took about 3 hrs to sort it out.
Thank you, Thank you, Thank you
Comment #12
dstol+1 on #6
Comment #13
jayatdrupal commentedWhy wouldn't the patch be to change this line:
drupal_set_header('HTTP/1.1 403 Forbidden');
to this one:
drupal_set_header('HTTP/1.0 403 Forbidden');
for nginx - as it needs to have HTTP/1.0 ?
It seems to work fine with that fix in...
Comment #14
ilya1st commentedOMG, Think that's not a bad way. Why ignored?
Comment #15
Jānis Bebrītis commentedbasically, moving to pressflow fixes this issue. it's all about drupal < 7 headers.
Comment #16
JimBroad commentedThis appears to be fixed in 6.x-dev, rather than use patch in #4, the offending drupal_set_header() calls in common.inc were replaced like so:
This requires you to make sure your server is set up to serve HTTP/1.0 for nginx.
#6 gave sample to do this but on our config we needed to add the following to drupal vhosts(http/https):
(note to the lack of trailing '1' from #6)
also, it appears ctools.module has a similar issue ctools_shutdown_handler():
header('HTTP1.1 200 OK');, but havn't yet to run into an issue with it yet.Comment #18
JimBroad commentedNo patches required, fix is already in core.
The rest of issue is server config.