Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: is Plack really necessary?

by Your Mother (Archbishop)
on Apr 25, 2018 at 17:24 UTC ( #1213544=note: print w/replies, xml ) Need Help??


in reply to is Plack really necessary?

tl;dr: Yes.

Plack is the namespace for an implementation of the PSGI standard. It is a more powerful modernization of and diversion from CGI. nginx wisely does not even support CGI (out of the box). That means you must use PSGI/Plack at least, though if you're feeling like redecorating your rooms in rubber you can use CGI beneath that. All modern Perl webframeworks (Catalyst, Mojolicious, Dancer2…) use PSGI as their interface layer because it is easily the best and most flexible way to do things today. Here is a simplistic but working set of code to run a toy app over PSGI through uWSGI/nginx.

Code <-> Dancer2 <-> PSGI <-> uWSGI <-> nginx <-> Clients

I recommend uWSGI over Starman.

Replies are listed 'Best First'.
Re^2: is Plack really necessary?
by dsheroh (Monsignor) on Apr 26, 2018 at 09:04 UTC
    In your diagram of the simplistic deployment stack, I notice a distinct lack of layers labeled "Plack". Or is your overall point that "Plack" really just means "any arbitrary implementation of PSGI"?

      Yes. We only happen to have one and it lives in Plack:: but it's just a PSGI implementation/harness; just like CGI.pm is a CGI spec implementation. I'm glad miyagawa chose to keep the names separate though I suppose both approaches have some points of confusion.

Re^2: is Plack really necessary?
by Anonymous Monk on Apr 26, 2018 at 20:57 UTC
    I see that ngnix can connect to Mojo's Hypnotoad without going through Plack pagi.what sort of protocol is used there?
    www.mind-it.info/2014/09/27/running-hypnotoad-behind-nginx/
      The configuration on the linked page shows nginx connecting to hypnotoad using proxy_pass, which connects to the back-end service using HTTP. This is also indicated by the backend having an http://... URL and the proxy_set_header X-Forwarded-Proto "http"; configuration setting.
        so there's no need for low level uwsgi/psgi protocol use?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1213544]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2022-05-17 17:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (68 votes). Check out past polls.

    Notices?