Nginx + Perl

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


Hello!

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

> Hi
> Nginx perfectly execute Perl scripts with the extensions *.cgi or *.pl
> (www.abc.com/bin/test_perl_script.cgi) via fastcgi.
> But I should execute Perl scripts without the extension. For example:
> www.abc.com/bin/test_perl_script
> 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:

http://wiki.nginx.org/HttpCoreModule#location

Maxim Dounin



More information about the nginx mailing list