# Phusion Passenger on a sub-URI - deleting my controller name

**URL:** <https://www.ruby-forum.com/t/phusion-passenger-on-a-sub-uri-deleting-my-controller-name/181289>\
**Category:** Rails\
**Created:** [January 8, 2010, 8:20pm UTC](https://www.ruby-forum.com/t/phusion-passenger-on-a-sub-uri-deleting-my-controller-name/181289 "2010-01-08T20:20:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dmorin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/f0a364/32.png) [@dmorin](https://www.ruby-forum.com/u/dmorin)\
**Post date:** [January 8, 2010, 8:20pm UTC](https://www.ruby-forum.com/t/phusion-passenger-on-a-sub-uri-deleting-my-controller-name/181289/1 "2010-01-08T20:20:35Z")

</div>

I know this must be a configuration error on my part but I can’t figure  
it out. I have a Rails application running on a sub-URI, and within  
that I have sevearl different controller/entry points. So in my  
httpd.conf file I’ve got the appropriate statements:  
RailsBaseURI /foo  
RailsBaseURI /bar  
RailsBaseURI /baz

Then in my docroot I’ve got softlinks appropriately:

ln -s /html/rails/myapp/public /html/docroot/www/foo  
ln -s /html/rails/myapp/public /html/docroot/www/bar  
ln -s /html/rails/myapp/public /html/docroot/www/baz

And lastly in /html/rails/myapp/app/controllers I’ve got:  
foo\_controller.rb  
bar\_controller.rb  
baz\_controller.rb

I’ve done no special manipulations to the config/routes.rb file.

This has all been working fine, in production, for months. if I point  
to [foobar.com/foo](http://foobar.com/foo) I go to the right place.

However for a new project I added a fourth controller, we’ll call it  
/quux.  
I did all of the above, creating a base uri, a soft link, and my  
controller.

What’s weird is that when I try to deploy it I’m constantly getting an  
error "No route matches “”. What appears to be happening is that  
something in the process is eating my controller name, because if I  
point to /quux/quux, then the quux controller is invoked just fine. So  
Passenger is recognizing that it should hand off the request to my Rails  
app, but my apps basically getting “” as a request and there is no  
default route.

The other links work fine, and from everythign I can tell they are set  
up the exact same (but, obviously, they must not be). I could swear  
I’ve seen a similar “have to double the reference in the URI” problem in  
the past, but I can’t find it now that I need it. I’ve been searching,  
and found plenty of examples of setting up a sub-URI with Passenger, but  
nothign really dealing with this odd problem of the controller name not  
getting passed along.

---

<div class="post-metadata">

**Author:** ![dmorin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/f0a364/32.png) [@dmorin](https://www.ruby-forum.com/u/dmorin)\
**Post date:** [January 8, 2010, 8:30pm UTC](https://www.ruby-forum.com/t/phusion-passenger-on-a-sub-uri-deleting-my-controller-name/181289/2 "2010-01-08T20:30:08Z")

</div>

One thing I forgot – if I just fire this up with script\server and hit  
localhost:3000/quux, it works fine. So I don’t expect it has anything  
to do with this particular controller, or the routes. The best I can  
tell is that Passenger is stripping out the /quux part, and I can’t  
figure out why. It’s following it, I mean, I end up invoking my rails  
app in some way, right? So it clearly saw my link and understood what  
to do with it. But then it ate it.

Duane M. wrote:

> I know this must be a configuration error on my part but I can’t figure  
> it out. I have a Rails application running on a sub-URI, and within  
> that I have sevearl different controller/entry points. So in my  
> httpd.conf file I’ve got the appropriate statements:  
> RailsBaseURI /foo  
> RailsBaseURI /bar  
> RailsBaseURI /baz
> 
> Then in my docroot I’ve got softlinks appropriately:
> 
> ln -s /html/rails/myapp/public /html/docroot/www/foo  
> ln -s /html/rails/myapp/public /html/docroot/www/bar  
> ln -s /html/rails/myapp/public /html/docroot/www/baz
> 
> And lastly in /html/rails/myapp/app/controllers I’ve got:  
> foo\_controller.rb  
> bar\_controller.rb  
> baz\_controller.rb
> 
> I’ve done no special manipulations to the config/routes.rb file.
> 
> This has all been working fine, in production, for months. if I point  
> to [foobar.com/foo](http://foobar.com/foo) I go to the right place.
> 
> However for a new project I added a fourth controller, we’ll call it  
> /quux.  
> I did all of the above, creating a base uri, a soft link, and my  
> controller.
> 
> What’s weird is that when I try to deploy it I’m constantly getting an  
> error "No route matches “”. What appears to be happening is that  
> something in the process is eating my controller name, because if I  
> point to /quux/quux, then the quux controller is invoked just fine. So  
> Passenger is recognizing that it should hand off the request to my Rails  
> app, but my apps basically getting “” as a request and there is no  
> default route.
> 
> The other links work fine, and from everythign I can tell they are set  
> up the exact same (but, obviously, they must not be). I could swear  
> I’ve seen a similar “have to double the reference in the URI” problem in  
> the past, but I can’t find it now that I need it. I’ve been searching,  
> and found plenty of examples of setting up a sub-URI with Passenger, but  
> nothign really dealing with this odd problem of the controller name not  
> getting passed along.
