nginx + cgit + debian = one host

By: Botched Partdridge | 8 Months | Syntax: Plain Text | Views: 223
URL http://paste.itunix.eu/view/ae5aeb27

  1. root@raspberrypi:/var/www# cat /etc/nginx/sites-enabled/www
  2. server {
  3.  
  4.     listen 80;
  5.     server_name home.control;
  6.  
  7.     root /var/www;
  8.     index index.php index.html index.htm;
  9.  
  10.     location / {
  11.         try_files $uri $uri/ =404;
  12.         autoindex on;
  13.     }
  14.  
  15.     location ~ \.php$ {
  16.         try_files $uri =404;
  17.         fastcgi_split_path_info ^(.+\.php)(/.+)$;
  18.         fastcgi_pass unix:/var/run/php5-fpm.sock;
  19.         fastcgi_index index.php;
  20.         fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  21.         include fastcgi_params;
  22.     }
  23.  
  24.     location /git {
  25.         gzip off;
  26.         alias /usr/local/cgit/share;
  27.         try_files $uri @cgit;
  28.     }
  29.  
  30.     location @cgit {
  31.         fastcgi_pass   unix:/tmp/cgi.sock;
  32.  
  33.         fastcgi_param  QUERY_STRING       $query_string;
  34.         fastcgi_param  REQUEST_METHOD     $request_method;
  35.         fastcgi_param  CONTENT_TYPE       $content_type;
  36.         fastcgi_param  CONTENT_LENGTH     $content_length;
  37.  
  38.         fastcgi_param  REQUEST_URI        $request_uri;
  39.         fastcgi_param  DOCUMENT_URI       $document_uri;
  40.         fastcgi_param  SERVER_PROTOCOL    $server_protocol;
  41.  
  42.         fastcgi_param  GATEWAY_INTERFACE  CGI/1.1;
  43.         fastcgi_param  SERVER_SOFTWARE    nginx/$nginx_version;
  44.  
  45.         fastcgi_param  REMOTE_ADDR        $remote_addr;
  46.         fastcgi_param  REMOTE_PORT        $remote_port;
  47.         fastcgi_param  SERVER_ADDR        $server_addr;
  48.         fastcgi_param  SERVER_PORT        $server_port;
  49.         fastcgi_param  SERVER_NAME        $server_name;
  50.  
  51.         # Tell nginx to consider everything after /git as PATH_INFO. This way
  52.         # we get nice, clean URLs
  53.         fastcgi_split_path_info           ^(/git)(/?.+)$;
  54.  
  55.         # Unfortunately the version of fcgiwrap currently available in Debian
  56.         # squeeze removes the PATH_INFO variable from the CGI environment and
  57.         # sets a new one based on DOCUMENT_ROOT and SCRIPT_NAME, so the line
  58.         # below wont work
  59.         #fastcgi_param  PATH_INFO         $fastcgi_path_info;
  60.         # Tell fcgiwrap about the binary wed like to execute and cgit about
  61.         # the path wed like to access.
  62.         fastcgi_param  SCRIPT_NAME        /cgit.cgi$fastcgi_path_info;
  63.         fastcgi_param  DOCUMENT_ROOT      /usr/local/cgit/bin;
  64.     }
  65.  
  66.     #ssl_certificate /etc/nginx/ssl/nginx.crt;
  67.     #ssl_certificate_key /etc/nginx/ssl/nginx.key;
  68. }

Reply to "nginx + cgit + debian = one host"

Here you can reply to the paste above