https://github.com/sh4dowbyte/marzban-nginx-node
https://github.com/sh4dowbyte/marzban-nginx-node
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/sh4dowbyte/marzban-nginx-node
- Owner: sh4dowByte
- License: mit
- Created: 2026-02-25T03:05:54.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2026-03-17T21:29:26.000Z (3 months ago)
- Last Synced: 2026-03-18T10:05:07.240Z (3 months ago)
- Size: 587 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## π§© Marzban + Nginx + Node
**Marzban + Nginx Reverse Prox + Nodey** in Docker π³
This repository provides a complete setup using **Docker Compose** to run [Marzban](https://github.com/Gozargah/Marzban) (an Xray management panel) with **Nginx reverse proxy** and **SSL certificate** support.
---
### β¨ Features
* π Nginx reverse proxy for managing VMess, VLESS, Trojan, and Shadowsocks traffic
* π Marzban panel accessible via a public port (`8899`)
* π Xray protocol access only via reverse proxy (no raw port exposure)
* π¦ Persistent configuration to ensure data remains safe even after `docker compose down`
* π§ Compatible with servers without public IPs, optionally integrates with **Cloudflare Tunnel**
---
### π Folder Structure
```
.
βββ docker-compose.yml # Main Docker Compose file
βββ nginx.conf # Main Nginx configuration
βββ xray.conf # Reverse proxy virtual host for all protocols
βββ marzban/
β βββ xray_config.json # Xray configuration (VMess, VLESS, etc.)
```
---
## π Quick Start
Clone this repository and start the services:
```bash
git clone https://github.com/sh4dowByte/marzban-nginx-node.git
cd marzban-nginx-node
```
## βοΈ Using Cloudflare Tunnel
To run Marzban + Nginx + Cloudflare Tunnel:
```bash
docker compose up -d
```
Ensure your `.env` file contains your Cloudflare Tunnel token:
```env
TUNNEL_TOKEN=your_cloudflare_token
```
---
## βοΈ Secure & Easy Access to Marzban via Cloudflare Tunnel
Want to access your **Marzban panel** securely without exposing ports? Use **Cloudflare Tunnel** with a subpath like:
### π Example:

Access Marzban at:
```
https://YOUR_DOMAIN/dashboard
```
---
### βοΈ Marzban Node Settings Example:

After setting up the node, make sure to properly configure the SSL certificate.
### π File Location
Navigate to the following file:
```
ssl/ssl_client_cert.pem
```
### βοΈ Steps
1. Open the **Marzban Panel Dashboard**
2. Go to **Node / Connection Settings**
3. Find the **SSL Client Certificate**
4. Copy the entire certificate content
5. Open the file:
```
ssl/ssl_client_cert.pem
```
6. Replace all contents of the file with the copied certificate
7. Save the file
### β οΈ Important Notes
* Make sure the format remains valid (usually starts with):
```
-----BEGIN CERTIFICATE-----
```
and ends with:
```
-----END CERTIFICATE-----
```
* Do not add extra spaces or characters
* Use UTF-8 encoding without BOM
---
### βοΈ Marzban Panel Settings Example:
| VMESS | VLESS | TROJAN |
| ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- |
|  |  |  |
---
### β¨ Benefits:
* π **Secure**: No need to expose port 80/443 publicly
* βοΈ **Reliable**: Leverages Cloudflareβs infrastructure β perfect for servers without public IPs
* π― **Custom Path**: Run the panel under a subpath like `/dashboard`
* π‘ **Cost-Effective**: No need for static IP or premium VPS
### β οΈ Cons:
* π **Slight Latency Overhead** : Requests go through Cloudflareβs edge, adding a small delay compared to direct IP access
* π§ **Tunnel Dependency** : If the Cloudflare Tunnel fails, access to your panel is lost (unless you expose it directly too)
* π **Cloudflare Account Required** : You must have a Cloudflare account and configure a domain or use a token
* π§ͺ **Debugging Complexity** : Troubleshooting reverse proxy or path issues can be more complex compared to direct hosting
---
Thanks to the open-source community for continuously strengthening the Xray and Marzban ecosystem! πͺπ
---