Nginx + Perl

Maxim Dounin mdounin at
Mon Jan 24 15:35:51 MSK 2011


On Mon, Jan 24, 2011 at 06:41:21AM -0500, daozor wrote:

> Hi
> Nginx perfectly execute Perl scripts with the extensions *.cgi or *.pl
> ( via fastcgi.
> But I should execute Perl scripts without the extension. For example:
> How to configure nginx.conf file.

nginx looks on URI to determine how requests should be processed, 
and you have to pass appropriate URIs to fastcgi.  I.e. to pass 
/bin/test_perl_script to fastcgi you should write something like 
this in your nginx config:

    location = /bin/test_perl_script {
        fastcgi_pass ...

To pass everything under /bin/ write something like this:

    location /bin/ {
        fastcgi_pass ...

See here for more details:

Maxim Dounin

More information about the nginx mailing list