summaryrefslogtreecommitdiff
path: root/nginx.conf
blob: 2b96fa1d20b8b94a3183b30e54a010f6e17da81f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#user http;
worker_processes  1;

#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

#pid        logs/nginx.pid;


# Load all installed modules
include modules.d/*.conf;

events {
	worker_connections  1024;
}


http {
	include       mime.types;
	default_type  application/octet-stream;
	sendfile        on;
	keepalive_timeout  65;
	# gzip on;

	server {
		listen       510;
		# server_name  git.physick.ru;
		# server_name 192.168.110.109;

		root                  /usr/share/cgit;
		try_files             $uri @cgit;

		location ~* ^/(cgit.(css|png|js|svg)|favicon.ico|robots.txt|cgit_bak.css|(switch|search).svg) {
			root /usr/share/webapps/cgit;
			expires 30d;
		}


		location ~ /.+/(info/refs|git-upload-pack) {
			include             fastcgi_params;
			fastcgi_param       SCRIPT_FILENAME     /usr/lib/git-core/git-http-backend;
			fastcgi_param       PATH_INFO           $uri;
			fastcgi_param       GIT_HTTP_EXPORT_ALL 1;
			fastcgi_param       GIT_PROJECT_ROOT    /srv/git;
			fastcgi_param       HOME                /srv/git;
			fastcgi_pass        unix:/run/fcgiwrap.sock;
		}

		location @cgit {
			include             fastcgi_params;
			fastcgi_param       SCRIPT_FILENAME /usr/lib/cgit/cgit.cgi;
			fastcgi_param       PATH_INFO       $uri;
			fastcgi_param       QUERY_STRING    $args;
			fastcgi_param       HTTP_HOST       $server_name;
			fastcgi_pass        unix:/run/fcgiwrap.sock;
		}
	}
}