Skip to content

Guide to setup caddy reverse proxy on ubuntu #14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: 2.x
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 33 additions & 1 deletion source/guides/caddy.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,36 @@
Caddy Configuration
===================

**TODO**
Open ports **80** and **443** in your firewall on router and in ubuntu firewall if you use it.

Get a domain, free ones can be found on duckdns https://www.duckdns.org among other place.

**Install caddy**

Follow https://caddyserver.com/docs/install and choose your supported distro.

in ubuntu is the following commands for installation

sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo apt-key add -
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee -a /etc/apt/sources.list.d/caddy-stable.list
sudo apt update
sudo apt install caddy

-

Make a new **text file** named **Caddyfile** file in whatever folder your want. Example documents. Text file can be created by cd to your location by cd command or right clicking in folder and opening terminal and typing example on ubuntu **gedit Caddyfile**

In the text file format as follows

.. code::

yourdomain.com {
reverse_proxy localhost:8080
}

now you may need to stop caddy web server before using its reverse proxy functionality do this by typing `sudo service caddy stop`

now in the same destination as your **Caddyfile** type `sudo caddy run`

Your done!