You are not logged in.

#1 2018-06-05 18:41:34

diederick76
Member
Registered: 2010-02-14
Posts: 157

directory index of /usr/share/webapps/cgit/ forbidden

Hi,

I'm trying to get cgit running behind Nginx using fcgiwrap:

server {
  listen                443;
  server_name           code.diederickdevries.net;
  root                  /usr/share/webapps/cgit;
  
  location ~* ^.+\.(css|png|ico)$ {
    expires 30d;
  }

  location @cgit {
    index		cgit.cgi;
    include             fastcgi_params;
    fastcgi_param	DOCUMENT_ROOT	$document_root;
    fastcgi_param       SCRIPT_FILENAME $document_root/cgit.cgi;
    fastcgi_param       PATH_INFO       $uri;
    fastcgi_param       QUERY_INFO	$uri;
    fastcgi_param       HTTP_HOST       $server_name;
    fastcgi_pass        unix:/run/fcgiwrap.sock;
  }

  access_log /var/log/nginx/code.access.log main; 
  error_log /var/log/nginx/code.error.log warn;

  include ssl.conf;
}

I have started fcgiwrap.sock as instructed on https://wiki.archlinux.org/index.php/Cg … g_fcgiwrap but when I request the subdomain, the browser returns a 403 Forbidden and the error log shows

2018/06/05 20:30:10 [error] 25525#25525: *1 directory index of "/usr/share/webapps/cgit/" is forbidden, client: 83.162.2.169, server: code.diederickdevries.net, request: "GET / HTTP/2.0", host: "code.diederickdevries.net"

I could chown /usr/share/webapps/cgit, but then ownership of the files would differ from the package. Is there a better way to give fcgiwrap access to the script?

Thanks for any help!

Offline

#2 2018-06-05 21:07:06

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,911

Re: directory index of /usr/share/webapps/cgit/ forbidden

Wiki example for nginx has some different lines, but also a different structure.

You don't have "try_lines" , also the "location @cgit" block is part of the server block in the wiki example.

Note : i know very little about nginx.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#3 2018-06-06 06:36:10

diederick76
Member
Registered: 2010-02-14
Posts: 157

Re: directory index of /usr/share/webapps/cgit/ forbidden

Thanks for the reply. The wiki example has a lot of problems and won't let Nginx start. I tried the other example using uwsgi and that works without problem.

Offline

#4 2018-06-06 12:35:06

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,911

Re: directory index of /usr/share/webapps/cgit/ forbidden

If you still feel like trying to get fciwrap to work, debian ships it with configuration examples.
https://packages.debian.org/sid/amd64/fcgiwrap/download


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#5 2018-06-06 18:37:37

diederick76
Member
Registered: 2010-02-14
Posts: 157

Re: directory index of /usr/share/webapps/cgit/ forbidden

Thanks! I'll try it out.

Offline

Board footer

Powered by FluxBB