aboutsummaryrefslogtreecommitdiff
path: root/nginx
diff options
context:
space:
mode:
Diffstat (limited to 'nginx')
-rw-r--r--nginx/homepage.conf49
1 files changed, 30 insertions, 19 deletions
diff --git a/nginx/homepage.conf b/nginx/homepage.conf
index 4976a6c..57a1d58 100644
--- a/nginx/homepage.conf
+++ b/nginx/homepage.conf
@@ -1,6 +1,6 @@
# https server
server {
- server_name jackjamison.net www.jackjamison.net ;
+ server_name jackjamison.net www.jackjamison.net;
error_page 404 = /404.html;
location = /404.html {
@@ -26,26 +26,37 @@ server {
}
-# http redirect
+# git server
server {
- listen [::]:80 ;
- listen 80 ;
- server_name jackjamison.net *.jackjamison.net ;
-
- return 301 https://$host$request_uri;
-}
-
+ server_name git.jackjamison.net;
+ root /usr/share/cgit;
+ try_files $uri @cgit;
+
+ 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 /var/git;
+ fastcgi_param HOME /var/git;
+ fastcgi_pass unix:/run/fcgiwrap.socket;
+ }
-### jackjamison.xyz redirect
+ 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.socket;
+ }
+}
-# https
+# http redirect
server {
- server_name jackjamison.xyz *.jackjamison.xyz ;
-
- listen [::]:80 ;
- listen 80 ;
- listen [::]:443 ssl;
- listen 443 ssl;
-
- return 301 https://jackjamison.net;
+ listen [::]:80;
+ listen 80;
+ server_name _;
+
+ return 301 https://$host$request_uri;
}