From de324606fa99300d2ec3fa82d9853d295871d569 Mon Sep 17 00:00:00 2001 From: Arya Kiran Date: Mon, 3 Apr 2023 19:24:31 +0530 Subject: [PATCH] add caddy and nginx instructions --- docs/setup_caddy.md | 11 +++++++++++ docs/setup_nginx.md | 31 +++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 docs/setup_caddy.md create mode 100644 docs/setup_nginx.md diff --git a/docs/setup_caddy.md b/docs/setup_caddy.md new file mode 100644 index 0000000..bcb20f0 --- /dev/null +++ b/docs/setup_caddy.md @@ -0,0 +1,11 @@ +# Setting up Caddy for GotHub + +Setting up caddy is not hard at all, and certificate generation is handled by itself for you. + +After installing caddy, append the following to the `Caddyfile`: + +```caddyfile +gothub.domain.tld { + reverse_proxy localhost:3000 +} +``` diff --git a/docs/setup_nginx.md b/docs/setup_nginx.md new file mode 100644 index 0000000..199830d --- /dev/null +++ b/docs/setup_nginx.md @@ -0,0 +1,31 @@ +# Setting up NginX for GotHub + +!!! note + + NginX does not support automatic certificate generation. You need to use `certbot` to create and maintain the certificates but that is out of scope of this tutorial. + +After installing NginX, create /etc/nginx/conf.d/gothub.conf with the following contents + +```nginx +server { + listen 80; + listen [::]:80; + listen 443 ssl http2; + listen [::]:443 ssl http2; + + server_name gothub.domain.tld; + + # Recommended but not required + access_log off; + error_log /var/log/nginx/error.log crit; + + location / { + proxy_pass http://127.0.0.1:3000; + proxy_set_header X-Forwarded-For $remote_addr; + proxy_set_header Host $host; # so GotHub knows domain + proxy_http_version 1.1; # to keep alive + proxy_set_header Connection ""; # to keep alive + } +} +``` +