Project

General

Profile

Actions

Bug #1684

closed

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

Added by Anonymous over 16 years ago. Updated 11 months ago.

Status:
Fixed
Priority:
High
Category:
core
Target version:
ASK QUESTIONS IN Forums:
No

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


Files

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

Updated by Anonymous over 16 years ago

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

Actions #2

Updated by stbuehler over 16 years ago

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

Actions #3

Updated by stbuehler over 16 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" => ( ... ) )
}
Actions #4

Updated by stbuehler about 16 years ago

  • Status changed from Fixed to Missing Feedback
Actions #5

Updated by gstrauss 11 months ago

  • Description updated (diff)
  • Status changed from Missing Feedback to Fixed
  • ASK QUESTIONS IN Forums set to No

Fixed per above comment.

Actions

Also available in: Atom