# Simplifying the software stack - any reason CGI can't be implemented into nginx?

**URL:** <https://www.ruby-forum.com/t/simplifying-the-software-stack-any-reason-cgi-cant-be-implemented-into-nginx/156559>\
**Category:** NGINX\
**Created:** [December 30, 2008, 12:40am UTC](https://www.ruby-forum.com/t/simplifying-the-software-stack-any-reason-cgi-cant-be-implemented-into-nginx/156559 "2008-12-30T00:40:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mike](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/58f4c7/32.png) [@mike](https://www.ruby-forum.com/u/mike)\
**Post date:** [December 30, 2008, 12:40am UTC](https://www.ruby-forum.com/t/simplifying-the-software-stack-any-reason-cgi-cant-be-implemented-into-nginx/156559/1 "2008-12-30T00:40:02Z")

</div>

Perhaps the way standard CGI programs run (compiled CGI, especially  
Perl, etc.) is not compatible with how nginx does it’s request  
processing, but couldn’t someone get a CGI module created for nginx so  
things like Apache don’t have to be used for Perl (or other CGI-based)  
apps?

I would love to get Apache out of the mix.

Or, some sort of php-fpm type FastCGI daemon thing that will handle  
CGI requests without requiring modification of the code? (I know there  
is some FCGI.pm thing, but that requires modifications to the code,  
right? I’d want it to be seamless)

---

<div class="post-metadata">

**Author:** ![mike](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/58f4c7/32.png) [@mike](https://www.ruby-forum.com/u/mike)\
**Post date:** [December 30, 2008, 12:06pm UTC](https://www.ruby-forum.com/t/simplifying-the-software-stack-any-reason-cgi-cant-be-implemented-into-nginx/156559/2 "2008-12-30T12:06:53Z")

</div>

On pon, gru 29, 2008 at 03:12:25 -0800, mike wrote:

> Perhaps the way standard CGI programs run (compiled CGI, especially  
> Perl, etc.) is not compatible with how nginx does it’s request  
> processing, but couldn’t someone get a CGI module created for nginx so  
> things like Apache don’t have to be used for Perl (or other CGI-based)  
> apps?

[http://nginx.localdomain.pl/wiki/FcgiWrap](http://nginx.localdomain.pl/wiki/FcgiWrap)

I took the liberty of adding it to the wiki page at:

[http://wiki.codemongers.com/NginxSimpleCGI](http://wiki.codemongers.com/NginxSimpleCGI)

> I would love to get Apache out of the mix.
> 
> Or, some sort of php-fpm type FastCGI daemon thing that will handle  
> CGI requests without requiring modification of the code? (I know there  
> is some FCGI.pm thing, but that requires modifications to the code,  
> right? I’d want it to be seamless)

With fcgiwrap you need to start it somehow (e.g. using spawn-fcgi or a  
simple Perl script from my website) but it’s basically fire and forget  
and needs no modification of existing scripts.

Best regards,  
Grzegorz N.

---

<div class="post-metadata">

**Author:** ![mike](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/58f4c7/32.png) [@mike](https://www.ruby-forum.com/u/mike)\
**Post date:** [December 30, 2008, 2:06pm UTC](https://www.ruby-forum.com/t/simplifying-the-software-stack-any-reason-cgi-cant-be-implemented-into-nginx/156559/3 "2008-12-30T14:06:27Z")

</div>

Personally, I think the current modular approach is the best for  
everyone.  
It offers the best flexibility and performance.
