WebFaction
Community site: login faq
0
1

In the past few months, I've noticed that two unrelated Drupal sites I'm hosting on WebFaction (one on 5.x and one on 6.x) have started showing four hex characters above the <!DOCTYPE> declaration on pages that return 404 or 403 errors.

For example:

3340
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">
    <head>
          <title>Access denied | [Site Name] </title>
...

This generally happens only the first time that a particular non-existent or permission-restricted page is accessed; on subsequent loads, the characters don't appear.

I don't know if this is a Drupal problem or a problem with the server's Apache or PHP configuration. My suspicion is the latter, since it's occurring in two completely different Drupal versions, and started happening only a few months ago. I did not make any code modifications within that timeframe -- and certainly no Drupal configuration changes that could affect both unrelated sites.

Unfortunately I don't have any copies of my sites running on other servers, so I can't isolate the problem that way.

Any ideas?

asked 01 Jan '11, 12:38

kpozin
112
accept rate: 0%


You should be able to fix this problem by adding the following to your .htaccess file:

SetEnv force-response-1.0 1
SetEnv downgrade-1.0 1

The problem is caused because Drupal explicitly sets HTTP/1.1 as the protocol when setting the 404 header, yet Nginx (being used to proxy requests) uses HTTP/1.0 when communicating with the backend Apache server.

permanent link

answered 01 Jan '11, 12:52

aaronh ♦♦
1.3k3
accept rate: 34%

Thank you! Is there any possibility that potentially breaking server changes (like this change in the proxy setup) be announced by email or on the Webfaction status blog, so that site administrators know what to look for when something stops working?

(01 Jan '11, 18:14) kpozin

There was no change in the proxy setup. We've been using this particular combination of Nginx and Apache for a couple of years now, and this issue has always existed for applications that make invalid assumptions about the server environment, such as Drupal (in its drupal_set_header function).

(01 Jan '11, 18:20) seanf
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×262
×225
×63
×22

question asked: 01 Jan '11, 12:38

question was seen: 5,293 times

last updated: 01 Jan '11, 18:20

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM