diff options
| author | Jack Jamison <jackqjamison@gmail.com> | 2026-07-02 23:45:58 -0400 |
|---|---|---|
| committer | Jack Jamison <jackqjamison@gmail.com> | 2026-07-02 23:45:58 -0400 |
| commit | 3edcb4557a0525c1a3923c2404069efdecea0403 (patch) | |
| tree | 84d8230aea847007eb75be43671f6b0b9ca8d949 | |
| parent | 861af260e7ed5f667e0579c4b35aaf9c930c8c58 (diff) | |
cgit
| -rw-r--r-- | nginx/homepage.conf | 49 | ||||
| -rwxr-xr-x | scripts/deploy.sh | 4 |
2 files changed, 32 insertions, 21 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; } diff --git a/scripts/deploy.sh b/scripts/deploy.sh index a258c9d..f3040b8 100755 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -3,12 +3,12 @@ # grab latest git pull -# setup gninx +# setup nginx cp ./nginx/homepage.conf /etc/nginx/sites-enabled/homepage.conf -mkdir /var/www/homepage/ # build and sync zola (cd zola-static && zola build) +mkdir /var/www/homepage/ rsync -av --delete ./zola-static/public/ /var/www/homepage/ # sync interactive |
