Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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!

like image 716
Беров Avatar asked Aug 07 '11 10:08

Беров


2 Answers

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.

like image 96
Ashley Avatar answered Nov 12 '22 07:11

Ashley


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

like image 38
Thomas Erskine Avatar answered Nov 12 '22 07:11

Thomas Erskine