summaryrefslogtreecommitdiff
path: root/etc/nginx
diff options
context:
space:
mode:
authorXiao Pan <gky44px1999@gmail.com>2023-12-16 12:32:48 +0000
committerXiao Pan <gky44px1999@gmail.com>2023-12-16 12:32:48 +0000
commite4f793d7dd1d9d264870a84632ea7cdcbe514ebc (patch)
tree82c40cd13f7dd2829a84505d822ac903b792b4c9 /etc/nginx
parenteec875242c94c0e79f9f48793f897b2822b0c73f (diff)
try use nginx and uwsgi
Diffstat (limited to 'etc/nginx')
-rw-r--r--etc/nginx/nginx.conf25
1 files changed, 25 insertions, 0 deletions
diff --git a/etc/nginx/nginx.conf b/etc/nginx/nginx.conf
index 051b3407..072089c5 100644
--- a/etc/nginx/nginx.conf
+++ b/etc/nginx/nginx.conf
@@ -119,6 +119,31 @@ http {
# }
#}
+ # https://wiki.archlinux.org/title/Cgit#Using_uwsgi
+ # https://wiki.gentoo.org/wiki/User:Halcon/HOWTO_cgit_uwsgi_nginx
+ # https://uwsgi-docs.readthedocs.io/en/latest/Nginx.html
+ # https://nginx.org/en/docs/http/ngx_http_uwsgi_module.html
+ server {
+ listen 80;
+ server_name git.flylightning.xyz;
+ root /usr/share/webapps/cgit;
+
+ # Serve static files with nginx
+ location ~* ^.+(cgit.(css|png)|favicon.ico|robots.txt) {
+ root /usr/share/webapps/cgit;
+ expires 30d;
+ }
+ location / {
+ try_files $uri @cgit;
+ }
+ location @cgit {
+ gzip off;
+ include uwsgi_params;
+ uwsgi_modifier1 9;
+ uwsgi_pass unix:/run/uwsgi/cgit.sock;
+ }
+ }
+
}
# vim: expandtab