Configuring Caddy on Seedbox with no root

Hello,
I’m trying to install & configure caddy on a seedbox, and i don’t have root access, my seedbox provider gave me an old instructions and told me it might not work as they didn’t maintain it.

First time setting up reverse proxy so not sure what to do (would pay someone to help tbh as i couldn’t figure it out yet)

1. Caddy version (caddy version):

latest

2. How I run Caddy:

screen -dmS caddy ~/caddy/caddy -conf ~/caddy/Caddyfile -http-port 54379 -https-port 59957

a. System environment:

5.4.31-gentoo

b. Command:

screen -dmS caddy ~/caddy/caddy -conf ~/caddy/Caddyfile -http-port 54379 -https-port 59957

screen -r caddy


#### c. Service/unit/compose file:
<!-- If using Docker/systemd/Kubernetes/make etc. -->

paste full file contents here


#### d. My complete Caddyfile or JSON config:
Don't know if it's correct

 **my.domain.com** {
 tls {
 dns cloudflare
 }
 gzip
 proxy /**site** localhost:**52194**
 proxy /**site** localhost:**52195**
 proxy /**site** localhost:**52196** {
 transparent
         }
 }

3. The problem I’m having:

I don’t see it working and i’m not sure how to configure it so when i go to subdomain.mydomain.com to send me plex/emby on my seedbox on diffrent ports

6. Links to relevant resources:

This is the Instructions i have. if you may please assist on any changes and how to proceed.

Downloading the server

  1. Create the needed directories
 mkdir ~/caddy
  1. Change to the directory
 cd ~/caddy
  1. Download the latest version of the Caddy Server
 wget "https://caddyserver.com/download/linux/amd64?plugins=tls.dns.cloudflare&license=personal"
  1. Extract the download’
 tar xzvf 'amd64?plugins=tls.dns.cloudflare&license=personal'
  1. Clean up
 rm -rf 'amd64?plugins=tls.dns.cloudflare&license=personal'

Configuration

  1. Create the configuration file
 touch ~/caddy/Caddyfile
  1. Edit the config
 nano ~/caddy/Caddyfile
  1. Copy in the example config
 **my.domain.com** {
 tls {
 dns cloudflare
 }
 gzip
 proxy /**site** localhost:**52194**
 proxy /**site** localhost:**52195**
 proxy /**site** localhost:**52196** {
 transparent
         }
 }
  1. Adust the bold values to enter your own domain/sub-domain, the site value is what needs to be entered after the domain to access the service. In this example, https://my.domain.com/site would display whatever service was running at localhost:52194 More proxy sites can be added by adding additional lines (proxy / site localhost: 52194 ) as long as formatting is kept.

Starting the server

  1. Users do no not have root access so a few changes need to be made to ensure things can run.
  2. Setup Cloudflare details for screen to use
 nano ~/.screenrc
  1. Copy in the below and edit to match your own details
 setenv CLOUDFLARE_EMAIL abc
 setenv CLOUDFLARE_API_KEY 123
  1. Now run the server in screen, random ports have been set for your use.
 screen -dmS caddy ~/caddy/caddy -conf ~/caddy/Caddyfile -http-port 54379 -https-port 59957
  1. You will need to accept the terms on the first run and provide your email address for Lets Encrypt
 screen -r caddy
 
 then *ctrl + a*, then *d* to exit the screen but not stop it running

This topic was automatically closed after 30 days. New replies are no longer allowed.