同一 nginx 虚拟主机中的多个 (fastcgi/uwsgi/scgi/proxy_pass) Mojolicious 应用程序的示例?
我有一些基于 Mojolicious 的应用程序,它们可以在 Apache2 下使用 mod_cgi 和 mod_fastcgi 愉快地运行。
网址例如:
http://example.org/oneapp/path/info?foo=bar
http://example.org/oneapp?foo=bar
http://example.org/secondapp/path/info?foo=bar
http://example.org/thirdapp/path/info?baz=heh
#etc...
我使用 proxy_pass 将应用程序配置为 子域 相对成功 但我想保留旧的网址(只需从 apache2 切换到 nginx)。 我想保留相同的 url,但使用 nginx 运行应用程序。 我的配置应该是什么样子以及我应该如何运行应用程序。
提前致谢!
I have some Mojolicious-based apps which happily run under Apache2 with mod_cgi and mod_fastcgi.
The urls are for example:
http://example.org/oneapp/path/info?foo=bar
http://example.org/oneapp?foo=bar
http://example.org/secondapp/path/info?foo=bar
http://example.org/thirdapp/path/info?baz=heh
#etc...
I had relative success configuring the apps as subdomains using proxy_pass
but I would like to keep the old urls(just switch from apache2 to nginx).
I would like to keep the same urls but run the apps using nginx.
What should my configuration look like and how should I run the apps.
Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
既然你还没有答案,我将给出一个正确的,但完全不成熟且无代码的解决方案。检查 Mojolicious::Guides::Cookbook 中的 nginx 和 Plack 部署。将此与 Plack::Builder 混合,以便在同一服务器上部署多个应用程序。我可能会选择 Starman 作为服务器引擎,但这取决于您和您的具体需求。
基本上就是这样。抱歉,我没有适合您的代码,但是一旦您完成每个步骤,它应该完全符合您的要求;这些文档很好,并且可以用来自各个 Perl 开发人员的博客文章进行补充。
Since you haven’t got an answer, I’ll give a correct, but entirely half-baked and code-free, solution. Check the Mojolicious::Guides::Cookbook for nginx and Plack deployment. Mix this with Plack::Builder for deploying multiple applications on the same server. I’d go with Starman as the server engine probably but that is up to you and your specific needs.
That’s basically it. Sorry I don’t have code for you but that should do exactly what you want once you get through each step; the docs are good and can be supplemented with blog posts from various Perl devs.
另请参阅Mount 插件,它允许您在另一个 mojolicious 应用程序中添加一个 mojolicious 应用程序
see also the Mount Plugin which allows you to add one mojolicious app within another