Voltron, I have tried the same thing as you are trying. I have 3 proxies up and running with cherokee. On main proxy open to the internet, which proxies two other proxies on a virtual network, and these proxies round-robin my application servers. On the main proxy I tried many different options to allow direct access to a particular application server on an internal domain. I settled on using subdomains in the end because it was just the cleanest way.
Though I did try using directory rules such as you. Taher explained this on a general level, but I will do into a little more detail... I was running into the same thing, a 404, but after a few more tries I realized it was actually doing the reverse proxy just fine. The problem is the proxy sends the URL pathname directly as it is to the resource server. So in your case, if you don't have anything like /admin setup on your resource server you'll get a 404. I got around this by utilizing the URL Rewrite settings on the Reverse Proxy handler. You can do something like this: /admin(.*) rewrites to ---> /$1 This makes any request on the proxy as /admin redirect to the root on the resource server. Jim On Oct 15, 2010, at 3:19 AM, Taher Shihadeh wrote: > On 14/10/10 14:13, Voltron wrote: >> Thanks Taher for your detailed explanation. Actually, the Cherokee >> documentation is very goo; the main reason why I choose Cherokee :) >> Until now, I could get everything to work as I expected. I think my >> particular case belongs to the cookbook. >> > Once you get it going it would be great if you could contribute the recipe > then ;-) > >> For the „/admin“ rule above >> >> Rule type : Directory >> Web directory: /admin >> Handler: HTTP Reverse Proxy >> Information source : "hello" on localhost:8080 >> >> >> If I navigate to localhost:8080, the backend renders a test page( as >> expected), navigating to localhost renders the cherokee test page( as >> expected), navigating to "localhost/admin" renders a 404. >> > Make sure http://localhost:8080/admin is there. > If you want to map http://localhost:80/admin to http://localhost:8080/ you'll > have to use some rewrites within the proxy handler configuration. > > As always, when everything else fails, CHEROKEE_TRACE is your friend. It is > hard to swallow at first, but it gets easier over time and is the ultimate > tool for these cases ;-) > >> Is there something that I have missed? By type:default you mean list >> and send, because default is not in the dropdown list >> >> > Nope. By 'default' type I meant the Default rule, the one of the bottom of > your rule-list, which is not modifiable since there has to be a fall-through > rule. > > -- > [email protected] > http://unixwars.com/ > > _______________________________________________ > Cherokee mailing list > [email protected] > http://lists.octality.com/listinfo/cherokee _______________________________________________ Cherokee mailing list [email protected] http://lists.octality.com/listinfo/cherokee
