# Need help getting perl cgis to work

**URL:** <https://www.ruby-forum.com/t/need-help-getting-perl-cgis-to-work/215479>\
**Category:** NGINX\
**Created:** [January 5, 2012, 2:26pm UTC](https://www.ruby-forum.com/t/need-help-getting-perl-cgis-to-work/215479 "2012-01-05T14:26:28Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![luislavena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/0ea827/32.png) [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Post date:** [January 5, 2012, 2:26pm UTC](https://www.ruby-forum.com/t/need-help-getting-perl-cgis-to-work/215479/1 "2012-01-05T14:26:28Z")

</div>

hey folks, ive been running apache for years but now trying to use  
nginx. I have nginx and php(with fastcgi)  
working fine, but whenever I try to bring up my web page that has a perl  
cgi on it, it just downloads the script  
instead of executing it… I cant figure out how to make it work right…  
basically heres the config that I have  
for it in my apache conf

ScriptAliasMatch ^/blog/?(.\*) /var/www/localhost/htdocs/blog/blog.pl/$1

and

\<Directory “/var/www/localhost/htdocs/blog”\>  
Options +Includes  
\<FilesMatch “blog.pl$”\>  
Options ExecCGI

when do I need to do to get nginx to properly execute the perl cgi?

thanks/regards,  
Jason

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [January 5, 2012, 2:43pm UTC](https://www.ruby-forum.com/t/need-help-getting-perl-cgis-to-work/215479/2 "2012-01-05T14:43:47Z")

</div>

On Thu, Jan 05, 2012 at 08:25:43AM -0500, [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

Hi there,

> hey folks, ive been running apache for years but now trying to use nginx. I have  
> nginx and php(with fastcgi)  
> working fine, but whenever I try to bring up my web page that has a perl cgi on  
> it, it just downloads the script

> when do I need to do to get nginx to properly execute the perl cgi?

nginx doesn’t do cgi.

You’ll need to run some separate server that nginx can talk to as a  
client, that is able to do whatever processing you want.

If you have a http server that handles the cgi for you, you can  
“proxy\_pass” to that.

If you have a fastcgi server that is set up to do the right thing with  
your cgi script, you can “fastcgi\_pass” to that.

There are also other options.

On the nginx side, you configure it in a similar way to your  
php-via-fastcgi configuration.

## f

Francis D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [January 5, 2012, 10:34pm UTC](https://www.ruby-forum.com/t/need-help-getting-perl-cgis-to-work/215479/3 "2012-01-05T22:34:24Z")

</div>

As others have mentioned, Nginx doesn’t support CGI.

Please see

[Getting Started | NGINX](http://wiki.nginx.org/Configuration#CGI)

for a couple different options.

Cliff

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [January 5, 2012, 3:35pm UTC](https://www.ruby-forum.com/t/need-help-getting-perl-cgis-to-work/215479/4 "2012-01-05T15:35:20Z")

</div>

Hi,

I use the

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

for mailgraph.cgi behind nginx.

BR  
Aleks

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [January 5, 2012, 10:56pm UTC](https://www.ruby-forum.com/t/need-help-getting-perl-cgis-to-work/215479/5 "2012-01-05T22:56:02Z")

</div>

You can find three different solutions here:

> **[Serving CGI Scripts With Nginx On Debian Squeeze/Ubuntu 11.04](https://www.howtoforge.com/serving-cgi-scripts-with-nginx-on-debian-squeeze-ubuntu-11.04)**
>
> Serving CGI Scripts With Nginx On Debian Squeeze/Ubuntu 11.04
> 
> This tutorial shows how you can serve CGI scripts (Perl scripts) with
> nginx on Debi...

(I prefer Fcgiwrap.)

----- Original Message -----  
From: [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
To: [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Sent: Thursday, January 05, 2012 2:25 PM  
Subject: need help getting perl cgis to work.

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [January 6, 2012, 3:42am UTC](https://www.ruby-forum.com/t/need-help-getting-perl-cgis-to-work/215479/6 "2012-01-06T03:42:15Z")

</div>

On Fri, Jan 6, 2012 at 4:55 AM, Falko T. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> You can find three different solutions here:

> **[Serving CGI Scripts With Nginx On Debian Squeeze/Ubuntu 11.04](https://www.howtoforge.com/serving-cgi-scripts-with-nginx-on-debian-squeeze-ubuntu-11.04)**
>
> Serving CGI Scripts With Nginx On Debian Squeeze/Ubuntu 11.04
> 
> This tutorial shows how you can serve CGI scripts (Perl scripts) with
> nginx on Debi...

> 

And another one here:

> **[The uWSGI project — uWSGI 2.0 documentation](https://uwsgi-docs.readthedocs.io/en/latest/)**

–  
O\< ascii ribbon campaign - stop html mail - [www.asciiribbon.org](http://www.asciiribbon.org)
