# How to Set Up an SSL endpoint for go-zenon with a Caddy Reverse Proxy

**URL:** https://forum.hypercore.one/t/how-to-set-up-an-ssl-endpoint-for-go-zenon-with-a-caddy-reverse-proxy/487
**Category:** How To
**Created:** [August 31, 2024, 8:45pm UTC](https://forum.hypercore.one/t/how-to-set-up-an-ssl-endpoint-for-go-zenon-with-a-caddy-reverse-proxy/487 "2024-08-31T20:45:07Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![0x3639](https://forum.hypercore.one/user_avatar/forum.hypercore.one/0x3639/32/33_2.png) [@0x3639](https://forum.hypercore.one/u/0x3639)
#### Post date: [August 31, 2024, 8:45pm UTC](https://forum.hypercore.one/t/how-to-set-up-an-ssl-endpoint-for-go-zenon-with-a-caddy-reverse-proxy/487/1 "2024-08-31T20:45:07Z")

</div>

### How to Set Up an SSL endpoint for go-zenon with a Caddy Reverse Proxy, Configure UFW Firewall, and Secure Your Server with Fail2ban

In this guide, I’ll walk you through setting up a reverse proxy with Caddy for your web applications, configuring UFW (Uncomplicated Firewall) to secure your server, and adding an extra layer of security with Fail2ban to protect against brute-force attacks.

#### **Step 1: Install Caddy**

First, make sure you have Caddy installed on your server. Here are the commands to install it:

```bash
sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https curl
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list
sudo apt update
sudo apt install caddy

```

#### **Step 2: Locate and Edit the Caddyfile**

Caddy’s main configuration file is called the `Caddyfile`. By default, this file is located at `/etc/caddy/Caddyfile`. To edit this file, you can use the `nano` text editor.

1. **Open the Caddyfile in Nano:**

2. **Add Your Configuration:**

- Make sure to change `example.com` to your domain name.

1. **Save and Exit Nano:**

#### **Step 3: Set Up UFW Firewall**

To secure your server, it’s crucial to configure UFW to allow only necessary traffic. Here’s how to do it:

1. **Enable UFW and Allow SSH (Port 22):**

2. **Allow TCP and UDP Traffic on Port 35995:**

3. **Enable UFW:**

4. **Verify UFW Status:**

#### **Step 4: Install and Configure Fail2ban**

Fail2ban is a service that monitors your server logs for suspicious activity, such as repeated failed login attempts, and bans the offending IP addresses. Here’s how to set it up:

1. **Install Fail2ban:**

2. **Create a Local Configuration:**

3. **Configure SSH Protection:**

4. **Start and Enable Fail2ban:**

5. **Check Fail2ban Status:**

#### **Step 5: Restart Caddy and Apply Changes**

After configuring the Caddyfile and setting up your firewall and Fail2ban, restart Caddy to apply the changes:

```bash
sudo systemctl restart caddy

```

#### **Final Notes**

With this setup, Caddy handles SSL termination and proxies requests to your backend services, UFW ensures that your server is protected by only allowing essential traffic, and Fail2ban provides an additional layer of security by blocking suspicious activity. This configuration is ideal for running web services securely and efficiently on a single server.

Feel free to ask any questions or share your experiences with this setup!

* * *

This post now includes instructions on how to locate and edit the Caddyfile using `nano`, making it more accessible for users who might not be familiar with where the Caddyfile is located or how to edit it.
