[Cppcms-users] lighttp + fastcgi configuration problem
Brought to you by:
artyom-beilis
From: Alexey U. <um...@gm...> - 2012-01-16 08:57:12
|
Hello! After running my test app behind the web back-end I've encountered a problem with URL dispatching. I have a virtual host on my machine "app.net" and appropriate record has been putted to /etc/hosts: "app.net 127.0.0.1". I'm running my app externally. My lighttp configuration related to subject is as follows: $HTTP["host"] == "app.net" { server.document-root = "/opt/sites/app/" alias.url += ("/scripts" => "/opt/sites/app/scripts" ) } # here I expect all address strings which contain "app.net" are delivered to my app fastcgi.server = ( "/" => (( "socket" => "/tmp/app-fcgi-socket", "max-procs" => 1, "check-local" => "disable" )) ) My CppCMS config: { "service" : { "api" : "fastcgi", "socket" : "/tmp/app-fcgi-socket" } } I manage URLs in following way: MyApp::MyApp(cppcms::service& srv) : cppcms::application(srv) { dispatcher().assign("", &MyApp::main, this); dispatcher().assign("/home", &MyApp::main, this); dispatcher().assign("/page1", &MyApp::page1, this); dispatcher().assign("/page2", &MyApp::page2, this); } void MyApp::main() { content::Home home; home.text = "Welcome home!"; render("Home", home); } void MyApp::page1() { content::Page1 page; page.text = "Page 1"; render("Page", page); } void MyApp::page2() { content::Page2 page; page.text = "Page"; render("Page2", page2); } I expected the following behavior: http://app.net -> "Welcome home!" http://app.net/page1 -> "Page 1" http://app.net/page2 -> "Page 2" but I'm getting the following: http://app.net -> "Welcome home!" http://app.net/page1 -> "Welcome home!" http://app.net/page2 -> "Welcome home!" And I've noticed that http://app.net -> "Welcome home!" http://app.net/asd/page1 -> "Page 1" http://app.net/asd/page2 -> "Page 2" (I can use any string in place of "asd" above and it's OK) Seems like there are lighttp configuration problem but I don't know how to cope with it. Any ideas about how to achieve what I expect? Thank you! |