Yasser Asmi
Yasser Asmi

Reputation: 1170

NGINX FastCGI without using spawn-fcgi

I am using NGINX's FastCGI interface. I currently launch my backend app with spawn-fcgi.

spawn-fcgi -p 8000 -n fcgitest

"man spawn-fcgi" gives a few reasons why I should use it to launch my app.--but I am not convinced those are good reasons for me.

Is it possible to launch my app (fcgitest) directly? For instance, that would make it easier to debug the app..

What are the downsides of launching it directly?

Upvotes: 2

Views: 3946

Answers (1)

Klaus
Klaus

Reputation: 2590

It is possible and it is a convenient approach to debugging. Take a look at this brilliant two-file library here. Not only it lets you run your application free of spawn-fcgi, but also it allows you to run it in a variety of ways suited for production.

Of course after developing your code it is recommended to launch the FastCGI application using spawn-fcgi as it is written it's manual page:

  • Privilege separation without needing a suid-binary or running a server as root.
  • You can restart your web server and the FastCGI applications without restarting the others.
  • You can run them in different chroot()s.
  • Running your FastCGI applications doesn't depend on the web server you are running, which allows for easier testing of other web servers.

Upvotes: 1

Related Questions