From 9920d404374275ef80b21421ae3a1ab8211fd88d Mon Sep 17 00:00:00 2001 From: Dmitry Ilvokhin Date: Sun, 3 Mar 2024 14:11:45 +0000 Subject: Rename git role to gitserver --- roles/gitserver/files/git.ilvokhin.com | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 roles/gitserver/files/git.ilvokhin.com (limited to 'roles/gitserver/files/git.ilvokhin.com') diff --git a/roles/gitserver/files/git.ilvokhin.com b/roles/gitserver/files/git.ilvokhin.com new file mode 100644 index 0000000..d94585f --- /dev/null +++ b/roles/gitserver/files/git.ilvokhin.com @@ -0,0 +1,26 @@ +server { + server_name git.ilvokhin.com; + + auth_basic "Restricted"; + auth_basic_user_file /etc/nginx/auth/git/.htpasswd; + + # Asterisk (*) is here to match both git.conf and cgit.conf (if the latter + # exists), because cgit comes with a separate role, but they share one + # server (git.ilvokhin.com) for usage convenience. + include includes/*git.conf; + + listen 443 ssl; + ssl_certificate /etc/letsencrypt/live/git.ilvokhin.com/fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live/git.ilvokhin.com/privkey.pem; +} + +server { + if ($host = git.ilvokhin.com) { + return 301 https://$host$request_uri; + } + + server_name git.ilvokhin.com; + listen 80; + + return 404; +} -- cgit v1.2.3-70-g09d2