Use bridge in example and add Caddy configuration in RP

This commit is contained in:
Akiyamov
2025-03-09 15:19:38 +05:00
committed by GitHub
parent a763027166
commit f780238221
2 changed files with 162 additions and 3 deletions

View File

@@ -0,0 +1,156 @@
---
sidebar_position: 3
slug: /installation/rp/caddy
title: Caddy
---
## Overview
In this guide we will use Caddy as a reverse proxy for requests to Remnawave.
We will redirect a domain to our server and configure Caddy. Caddy will handle issue of SSL certificates by itself.
Complete [Quick Start](/installation/quick-start) and [Env Variables](/installation/env) before continuing.
## Configuration
Requirements:
- Completed [Quick Start](/installation/quick-start)
- Completed [Env Variables](/installation/env)
- Registered domain name (e.g. `my-super-panel.com`)
:::warning
You should have a registered domain name to continue.
:::
## Point domain to your server
Check out your server IP address, it is better to use a static IPv4 address.
Now, you need to point your domain to your server.
For example, it will be `my-super-panel.com` -> `193.122.122.122`.
There are two ways to do this:
1. Use a DNS provider (e.g. Cloudflare, Google Cloud, etc.)
2. Use a registrar (e.g. Namecheap, etc.)
### DNS provider
If you use Cloudflare, you need to add a record to your DNS.
Log in to your Cloudflare account [here](https://dash.cloudflare.com/login).
Select domain, which you want to point to your server.
On the left side of the page, click on `DNS` and then click on `Records`.
Click on `Create record`.
Select `Type` as `A` and `Name` as `@`.
:::info
If you want to use subdomains, you should write subdomain name (e.g. `panel`) in the `Name` field.
:::
In the `IPv4 address` field, you should write your server IP address.
Click on `Save`.
Now, you need to wait for the DNS to be updated.
:::info
There are a big difference between yellow cloud (domain is proxied with Cloudflare) and grey cloud (domain is not proxied with Cloudflare) in the Cloudflare control panel.
We will return later to this topic in this guide, but for now it really depends on you.
If Cloudflare works fine in your region, it is better to proxy the domain with Cloudflare. (Yellow cloud)
:::
![static](/reverse-proxies/nginx/cloudflare-dns.webp)
Some DNS providers have a different interface, but the process is the same.
## Caddy configuration
### Simple configuration
Create a file `Caddyfile` in the `~/remnawave/caddy` folder.
```bash
cd ~/remnawave/caddy && nano Caddyfile
```
Paste the following configuration.
:::warning
Please, replace `REPLACE_WITH_YOUR_DOMAIN` with your domain name.
Review configuration below, look for red highlighted lines.
:::
```caddy title="Caddyfile"
// highlight-next-line-red
https://REPLACE_WITH_YOUR_DOMAIN {
reverse_proxy * http://remnawave:3000
}
:443 {
tls internal
respond 204
}
```
### Create docker-compose.yml
Create a file `docker-compose.yml` in the `~/remnawave/caddy` folder.
```bash
cd ~/remnawave/caddy && nano docker-compose.yml
```
Paste the following configuration.
```yaml title="docker-compose.yml"
services:
caddy:
image: caddy:2.9
container_name: 'caddy'
hostname: caddy
restart: always
ports:
- 443:443
networks:
- remnawave-network
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile
- caddy-ssl-data:/data
volumes:
caddy-ssl-data:
driver: local
external: false
name: caddy-ssl-data
```
### Start the container
```bash
docker compose up -d && docker compose logs -f -t
```
### Open the panel in the browser
Open the configured domain name in the browser and you will see login page.
![login-page](/reverse-proxies/nginx/login-page.webp)
## Troubleshooting
<Button label="Ask community" link="https://t.me/+YxzE4bOmEog2Zjhi" variant="secondary" size="md" outline style={{ marginBottom: '1rem' }} />

View File

@@ -7,7 +7,7 @@ title: Nginx
## Overview
In this guide we will use Nginx as a reverse proxy for requests to Remnawave.
We will redirect a domain to our server, issue an SSL certificate and configure Nginx.
We will redirect a domain to our server, issue a SSL certificate and configure Nginx.
Complete [Quick Start](/installation/quick-start) and [Env Variables](/installation/env) before continuing.
## Configuration
@@ -163,7 +163,7 @@ Review configuration below, look for red highlighted lines.
```nginx title="nginx.conf"
upstream remnawave {
server 127.0.0.1:3000;
server remnawave:3000;
}
# Connection header for WebSocket reverse proxy
@@ -280,7 +280,10 @@ services:
- ./fullchain.pem:/etc/nginx/ssl/fullchain.pem:ro
- ./privkey.key:/etc/nginx/ssl/privkey.key:ro
restart: always
network_mode: host
ports:
- 443:443
networks:
- remnawave-network
```
### Start the container