Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

(for simplicity I changed IPs of Apache server to and Gollum server to

I'm trying to serve a Gollum wiki with rack through Apache (since it has SSL set up properly and I'm currently only testing the Gollum wiki). So I setup Apache to ProxyPass (config below).

The problem is that the rack server seems to be working fine when I access it directly via a curl from my proxy machine: - - [05/Dec/2013 06:20:25] "GET /docs/Home HTTP/1.1" 200 6467 0.2135

but I get a 404 whenever I try to use my browser. Rackup says: - - [05/Dec/2013 06:20:00] "GET /docs/Home HTTP/1.1" 404 - 0.0006

Absurdly, when I use the exact same headers as my browser sends (see below) via telnet from the proxy machine ( the request is successful: - - [05/Dec/2013 06:19:19] "GET /docs/Home HTTP/1.1" 200 6467 0.2759

I have no idea what I'm doing wrong and why (and how?!) rack differentiates between two different requests from the same machine. Help please?

(Using Apache/2.2.15 on RHEL 5 and Rack 1.2 (Release: 1.5) on ruby 1.9.2p320, RHEL 6)

EDIT Apparently this is a problem with WEBrick, since when I switch to Thin it worked. Would still like your insights...

Apache config:



    DocumentRoot /path/to/my/docs
    DirectoryIndex index.html index.htm index.php

    # ...

    <Location /docs/>

        # also tried:
        # ProxyPass

        # and:
        # SetEnv force-proxy-request-1.0 1
        # SetEnv proxy-nokeepalive 1



Telnetted request:

<1>root@testserver:~$ telnet 8080
Connected to
Escape character is '^]'.
GET /docs/Home HTTP/1.1
ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
ACCEPT_ENCODING: gzip,deflate,sdch
ACCEPT_LANGUAGE: en-US,en;q=0.8,he;q=0.6
CACHE_CONTROL: max-age=0
COOKIE: SESS...; has_js=1
USER_AGENT: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.57 Safari/537.36

I verified that the rack up prints the same output for the normal browser request and the telnetted request using the code from this answer.

share|improve this question

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.