Cgi files in plain text


I installed nginx and php5-fpm from repositories on ubuntu 10.04.
everything works well. The phpinfo test file works.

I try to access collection (for collectd) pages. When I access the url
of the collection3/bin/index.cgi, I can see the file in plain text.

This is the config file used :
server {
listen 80;
access_log /var/log/nginx/localhost.access.log;

Default location

location / {
    root   /var/www;
    index  index.php;

try_files $uri $uri/ /index.php?q=$uri&$args;
auth_basic “Restricted”;
auth_basic_user_file /var/htpasswd_au1;



#location = /var/www {

auth_basic “Restricted”;

auth_basic_user_file /var/htpasswd_au1;


try_files $uri $uri/ /index.php?q=$uri;

Images and static content is treated different

location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|xml)$ {
  access_log        off;
  expires           30d;
  root /var/www;

Parse all .php file in the /var/www directory

location ~ .php$ {
    fastcgi_split_path_info ^(.+\.php)(.*)$;
    fastcgi_index  index.php;
    fastcgi_param  SCRIPT_FILENAME  /var/www$fastcgi_script_name;
    include fastcgi_params;
    fastcgi_param  QUERY_STRING     $query_string;
    fastcgi_param  REQUEST_METHOD   $request_method;
    fastcgi_param  CONTENT_TYPE     $content_type;
    fastcgi_param  CONTENT_LENGTH   $content_length;
    fastcgi_intercept_errors        on;
    fastcgi_ignore_client_abort     off;
    fastcgi_connect_timeout 60;
    fastcgi_send_timeout 180;
    fastcgi_read_timeout 180;
    fastcgi_buffer_size 128k;
    fastcgi_buffers 4 256k;
    fastcgi_busy_buffers_size 256k;
    fastcgi_temp_file_write_size 256k;

Disable viewing .htaccess & .htpassword

location ~ /\.ht {
    deny  all;

upstream backend {


Posted at Nginx Forum:,197100,197100#msg-197100

jeanjan Wrote:

plain text.
root /var/www;

auth_basic_user_file /var/htpasswd_au1;

    fastcgi_param  QUERY_STRING
    fastcgi_send_timeout 180;

upstream backend {


You can either use a php-based web interface for collectd like
php-collection or Collectd Graph Panel or if you need the ability to
serve .cgi and .pl files (like for awstats) you’ll have to install
another backend daemon.

You can use a light web server or I’d recommend fcgiwrap. A couple ppas
have Lucid backports of the Ubuntu fcgiwrap package, (e.g.

Posted at Nginx Forum:,197100,197123#msg-197123

Thank you, I found out how to access collectd-web cause it has its own

Posted at Nginx Forum:,197100,197988#msg-197988

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs