Example for several (fastcgi/uwsgi/scgi/proxy_pass) Mojolicious apps in the same nginx virtual host?
Asked Answered
M

2

7

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!

Marijuana answered 7/8, 2011 at 10:11 Comment(0)
S
6

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.

Shanna answered 11/8, 2011 at 1:28 Comment(1)
Well, thanks, this is good advise. I will try and make a complete example which I will put in my project and then link it here so people can enjoy it. Thanks again !Corrinecorrinne
L
1

see also the Mount Plugin which allows you to add one mojolicious app within another

Lenee answered 20/2, 2013 at 18:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.