mirror of
https://codeberg.org/gothub/docs
synced 2024-12-06 19:16:44 +01:00
add caddy and nginx instructions
This commit is contained in:
@@ -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
|
||||
}
|
||||
```
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user