我想我可以在 nginx
中使用位置管理多个应用程序。
但似乎我无法在具有不同端口的同一服务器上运行多个 dancer2
应用程序(例如 localhost:3000、localhost:4000)。
无论如何,我把它放在这里是希望专家们能给我一些启发。
最佳答案
当您有多个 Dancer2 应用程序时,您可以使用 Plack::App::URLMap 将它们组合在一起。或者它的包装器语法在 Plack::Builder 中可用:
use MyApp::Main;
use MyApp::Admin;
builder {
mount '/' => MyApp::Main->to_app;
mount '/admin' => MyApp::Admin->to_app;
};
安装的效果是这些应用程序将完全独立并且Plack::Builder将确保只有适当的应用程序才能处理给定的请求。
关于perl - 如何在同一个 nginx 服务器上运行多个 perl Dancer2 应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47652418/