rvs-prxy/README.md

67 lines
4.3 KiB
Markdown

## Purpose: Setup Reverse Proxy for your Application
```
+----------------------------+
| Target Server |
| |
| +---------+ |
| | | |
| | Traefik | |
+---------------------+ | | | |
| Any Linux Computer | | +---------+ |
| | | ^ |
| +-------------+ | | | |
| | | | Setup Reverse Proxy | +----+------------------+ |
| | This +-----+------------------------+->| | |
| | Automatical | | for your existing | | Reverse Proxy Setting | |
| | System |<-+ | application | | eg. www.domain.com | |
| | | | | | | | |
| +-------------+ | | | +------+----------------+ |
| | | | | |
| .env | | v |
| | | +-------------+ |
+---------------------+ | | | |
| | Existing | |
| | Application | |
| | | |
| +-------------+ |
| |
+----------------------------+
```
- .env -- **parameters for your Application, Reverse Proxy and Target information**
- Assume your "Application" is already existing.
- If Traefik does not exist, will create it dynmaically, Otherwise, use exsiting one.
- Remark: one Target Server has one unique Traefik instance running -- container name as traefik.
- All Application(s) must connect to docker network name **traefik-public** for container connection by expose port(s).
## Architecture
```
+-------------------+ +-------------------+
| Local Host | | Proxy Server |
| | | |
| +-------------+ | FRP Tunnel | +-------------+ |
| | Application | | <-----------------> | | Traefik | |<--- Domains
| | Service #1 | | Public IPs | | (Router) | | HTTPS/TLS
| | | | Port: 16999 | | | |
| +-------------+ | | +-------------+ |
| | | |
| +-------------+ | | +-------------+ |
| | FRPC | | | | FRPS | |
| | (Client) | | | | (Server) | |
| | | | | | | |
| +-------------+ | | +-------------+ |
| | | |
| | | +-------------+ |
| | | | Application | |
| | | | Service #2 | |
| | | | | |
+-------------------+ | +-------------+ |
+-------------------+
```
## Run this System
- `./auto-sys-deploy.sh setup-rvs-prxy`
- will apply the new `.env` setting to into traefik
- null traefik before, create new and apply those new setting
- OR already existing traefik, keep all old setting, then apply new setting