Project

General

Profile

Bug #1684

404 when linking to a Rails app instantiated by $HTTP["url"]

Added by Anonymous over 11 years ago. Updated almost 11 years ago.

Status:
Missing Feedback
Priority:
High
Assignee:
-
Category:
core
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Missing in 1.5.x:

Description

When the configuration below is used in Rails 1.4.19, it initially brings up the Rails application, but gives a 404 when any URL of the form http://server/rails_app/controller etc is used. I was able to replicate this behavior with several applications of instances of 1.4.19.

However, upon reverting to 1.4.13, the below configuration worked perfectly.


$HTTP["url"] =~ "^/<app_name>" {
server.document-root = "/var/rails/<app_name>/public/" 
alias.url = ( "/<app_name>/" => "/var/rails/<app_name>/public/" )
server.error-handler-404 = "dispatch.fcgi" 
server.indexfiles = ( "dispatch.fcgi")
fastcgi.server = (
".fcgi" =>
( "localhost" =>
( "socket" => "/var/rails/<app_name>/tmp/lighttpd-fcgi.socket",
"bin-path" => "/var/rails/<app_name>/public/dispatch.fcgi",
"bin-environment" => ( "RAILS_ENV" => "development" ),
"min-procs" => 1,
"max-procs" => 5,
"idle-timeout" => 60,
"allow-x-send-file" => "enable" ) ) )
}

-- august

config.rtf (895 Bytes) config.rtf Attached sample config as Trac munged inline config -- august Anonymous, 2008-06-07 04:26

History

#1

Updated by Anonymous over 11 years ago

The above post refers to a Rails 2 app in Lighttpd 1.4.19, I would assume.

#2

Updated by stbuehler over 11 years ago

server.error-handler-404 = "/dispatch.fcgi" or "check-local" => "disable" in the fastcgi server could help.

#3

Updated by stbuehler about 11 years ago

  • Status changed from New to Fixed
  • Resolution set to worksforme

The recommended way is to use mod_magnet/cleanurl for this (http://nordisch.org/cleanurl5.lua):


$HTTP["url"] =~ "^/<app_name>" {
alias.url = ( "/<app_name>/" => "/var/rails/<app_name>/public/" )
magnet.attract-physical-path-to = ( "/etc/lighttpd/cleanurl-v5.lua" )
fastcgi.server    = ( "dispatch.fcgi" => ( ... ) )
}
#4

Updated by stbuehler almost 11 years ago

  • Status changed from Fixed to Missing Feedback

Also available in: Atom