add caddy and nginx instructions

This commit is contained in:
Arya Kiran
2023-04-03 19:24:31 +05:30
parent d28053d7d0
commit de324606fa
2 changed files with 42 additions and 0 deletions
+11
View File
@@ -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
}
```
+31
View File
@@ -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
}
}
```