summaryrefslogtreecommitdiff
path: root/docs/server/cgit.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/server/cgit.md')
-rw-r--r--docs/server/cgit.md30
1 files changed, 30 insertions, 0 deletions
diff --git a/docs/server/cgit.md b/docs/server/cgit.md
index 72db5ed..f685118 100644
--- a/docs/server/cgit.md
+++ b/docs/server/cgit.md
@@ -110,6 +110,36 @@ Add cgit configuration to caddy.
}
}
+### Running cgit with nginx
+
+ server {
+ listen 80;
+ server_name git.joshuayun.com;
+ return 301 https://$host$request_uri;
+ }
+
+ server {
+ listen 443 ssl;
+ server_name git.joshuayun.com;
+
+ // Other nginx configs, e.g. ssl here
+
+ root /usr/share/cgit/;
+ try_files $uri @cgit;
+
+ location ~* ^.+\.(css|png|ico)$ {
+ root /usr/share/cgit/;
+ }
+
+ location / {
+ fastcgi_pass localhost:8999;
+ fastcgi_param SCRIPT_FILENAME /usr/lib/cgit/cgit.cgi;
+ fastcgi_param DOCUMENT_ROOT /usr/lib/cgit/;
+ fastcgi_param PATH_INFO $uri;
+ fastcgi_param QUERY_STRING $args;
+ fastcgi_param HTTP_HOST $server_name;
+ }
+ }
## Cgit configuration