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.
Thank you!
Posted at Nginx Forum:
daozor
January 24, 2011, 1:26pm
2
If perl-scripts without extension the browser tries to download a file,
instead of to execute…
Posted at Nginx Forum:
daozor
January 24, 2011, 1:37pm
3
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 D.
daozor
January 24, 2011, 2:25pm
4
In folder /var/www/twiki/bin there are many perl files:
attach
changes
configure
edit
login
logon
logos
manage
oops
preview
rdiff
rdiffauth
register
rename
resetpasswd
rest
save
search
statistics
twiki_cgi
upload
view
viewauth
viewfile
# file configure
configure: perl script text executable
Server/location in nginx.conf:
server {
listen 80;
server_name twiki;
location / {
root /var/www/twiki/;
index index.html;
}
location /twiki/bin {
root /var/www/twiki/bin/;
include /etc/nginx/fastcgi_params;
fastcgi_pass 127.0.0.1:10001;
fastcgi_param SCRIPT_FILENAME
/var/www/twiki$fastcgi_script_name;
}
}
Go to http://localhost/twiki/bin/configure and browser downloads a file
===
This example is work fine, but here *.cgi …
location ~ .cgi$ {
root /var/www/nagios/cgi-bin/;
rewrite ^/nagios/cgi-bin/(.*)\.cgi
/$1.cgi break;
include /etc/nginx/fastcgi_params;
fastcgi_pass 127.0.0.1:10001;
fastcgi_param SCRIPT_FILENAME
/var/www/nagios$fastcgi_script_name;
}
no ideas…
Posted at Nginx Forum:
daozor
January 24, 2011, 2:33pm
5
On Mon, Jan 24, 2011 at 8:23 PM, daozor [email protected] wrote:
fastcgi_pass 127.0.0.1:10001;
check if the fastcgi handler in fastcgi_pass accept non *.cgi / *.pl
files
daozor
January 24, 2011, 3:09pm
6
edogawaconan Wrote:
nginx mailing list
[email protected]
nginx Info Page
hmmm…
edogawaconan, how i can make it?
Posted at Nginx Forum:
daozor
January 24, 2011, 3:12pm
7
Probably a problem simply in a section location… maybe somehow use
rewrite or another variant…
Posted at Nginx Forum:
daozor
January 24, 2011, 3:26pm
8
On Mon, Jan 24, 2011 at 9:07 PM, daozor [email protected] wrote:
hmmm…
edogawaconan, how i can make it?
depends on the fastcgi backend itself. Nginx only passes the
parameters to fastcgi backend.
daozor
January 24, 2011, 3:38pm
9
edogawaconan Wrote:
depends on the fastcgi backend itself. Nginx only
passes the
parameters to fastcgi backend.
spawn-fcgi-1.4.18 - spawns fastcgi processes
fcgiwrap version 1.0
Posted at Nginx Forum:
daozor
January 24, 2011, 1:39pm
10
On Mon, Jan 24, 2011 at 7:25 PM, daozor [email protected] wrote:
If perl-scripts without extension the browser tries to download a file,
instead of to execute…
define in its own location { } block