Reproxy is a simple edge HTTP(s) server / reverse proxy supporting various providers (docker, static, file).
One or more providers supply information about requested server, requested url, destination url and health check url.
Distributed as a single binary or as a docker container.
- Automatic SSL termination with Let's Encrypt
- Support of user-provided SSL certificates
- Simple but flexible proxy rules
- Static, command line proxy rules provider
- Dynamic, file-based proxy rules provider
- Docker provider with an automatic discovery
- Optional traffic compression
- User-defined limits and timeouts
- Single binary distribution
- Docker container distribution
- Built-in static assets server
Server can be set as FQDN, i.e. s.example.com or * (catch all). Requested url can be regex, for example ^/api/(.*) and destination url may have regex matched groups in, i.e. http://d.example.com:8080/$1. For the example above http://s.example.com/api/something?foo=bar will be proxied to http://d.example.com:8080/something?foo=bar.
For convenience, requests with the trailing / and without regex groups expanded to /(.*), and destinations in those cases expanded to /$1. I.e. /api/ -> http://127.0.0.1/service will be translated to ^/api/(.*) -> http://127.0.0.1/service/$1
Both HTTP and HTTPS supported. For HTTPS, static certificate can be used as well as automated ACME (Let's Encrypt) certificates. Optional assets server can be used to serve static files.
Starting reproxy requires at least one provider defined. The rest of parameters are strictly optional and have sane default.
Example with a static provider:reproxy --static.enabled --static.rule="example.com/api/(.*),https://api.example.com/$1"
Example with an automatic docker discovery:reproxy --docker.enabled --docker.auto
Install
- for a binary distribution pick the proper file in the release section
- docker container available on Docker Hub as well as on Github Container Registry. I.e.
docker pull umputun/reproxyordocker pull ghcr.io/umputun/reproxy.
Latest stable version has :vX.Y.Z tag (with :latest alias) and the current master has :master tag.
Providers
Proxy rules supplied by various providers. Currently included file, docker and static. Each provider may define multiple routing rules for both proxied request and static (assets). User can sets multiple providers at the same time.
See examples of various providers in examples
Static
This is the simplest provider defining all mapping rules directly in the command line (or environment). Multiple rules supported.
Each rule is 3 or 4 comma-separated elements server,sourceurl,destination,[ping-url]. For example:
*,^/api/(.*),https://api.example.com/$1,- proxy all request to any host/server with/apiprefix tohttps://api.example.comexample.com,/foo/bar,https://api.example.com/zzz,https://api.example.com/ping- proxy all requests toexample.comand with/foo/barurl tohttps://api.example.com/zzz. Useshttps://api.example.com/pingfor the health check
The last (4th) element defines an optional ping url used for health reporting. I.e.*,^/api/(.*),https://api.example.com/$1,https://api.example.com/ping. See Health check section for more details.
File
reproxy --file.enabled --file.name=config.yml
Example of config.yml:
default: # the same as * (catch-all) server
+Reproxy Reproxy is a simple edge HTTP(s) server / reverse proxy supporting various providers (docker, static, file).
One or more providers supply information about requested server, requested url, destination url and health check url.
Distributed as a single binary or as a docker container.
- Automatic SSL termination with Let's Encrypt
- Support of user-provided SSL certificates
- Simple but flexible proxy rules
- Static, command line proxy rules provider
- Dynamic, file-based proxy rules provider
- Docker provider with an automatic discovery
- Support of multiple (virtual) hosts
- Optional traffic compression
- User-defined limits and timeouts
- Single binary distribution
- Docker container distribution
- Built-in static assets server
Server (host) can be set as FQDN, i.e. s.example.com or * (catch all). Requested url can be regex, for example ^/api/(.*) and destination url may have regex matched groups in, i.e. http://d.example.com:8080/$1. For the example above http://s.example.com/api/something?foo=bar will be proxied to http://d.example.com:8080/something?foo=bar.
For convenience, requests with the trailing / and without regex groups expanded to /(.*), and destinations in those cases expanded to /$1. I.e. /api/ -> http://127.0.0.1/service will be translated to ^/api/(.*) -> http://127.0.0.1/service/$1
Both HTTP and HTTPS supported. For HTTPS, static certificate can be used as well as automated ACME (Let's Encrypt) certificates. Optional assets server can be used to serve static files.
Starting reproxy requires at least one provider defined. The rest of parameters are strictly optional and have sane default.
Example with a static provider:
reproxy --static.enabled --static.rule="example.com/api/(.*),https://api.example.com/$1"
Example with an automatic docker discovery:
reproxy --docker.enabled --docker.auto
Install
- for a binary distribution pick the proper file in the release section
- docker container available on Docker Hub as well as on Github Container Registry. I.e.
docker pull umputun/reproxy or docker pull ghcr.io/umputun/reproxy.
Latest stable version has :vX.Y.Z tag (with :latest alias) and the current master has :master tag.
Providers
Proxy rules supplied by various providers. Currently included file, docker and static. Each provider may define multiple routing rules for both proxied request and static (assets). User can sets multiple providers at the same time.
See examples of various providers in examples
Static
This is the simplest provider defining all mapping rules directly in the command line (or environment). Multiple rules supported.
Each rule is 3 or 4 comma-separated elements server,sourceurl,destination,[ping-url]. For example:
*,^/api/(.*),https://api.example.com/$1, - proxy all request to any host/server with /api prefix to https://api.example.comexample.com,/foo/bar,https://api.example.com/zzz,https://api.example.com/ping - proxy all requests to example.com and with /foo/bar url to https://api.example.com/zzz. Uses https://api.example.com/ping for the health check
The last (4th) element defines an optional ping url used for health reporting. I.e.*,^/api/(.*),https://api.example.com/$1,https://api.example.com/ping. See Health check section for more details.
File
reproxy --file.enabled --file.name=config.yml
Example of config.yml:
default: # the same as * (catch-all) server
- { route: "^/api/svc1/(.*)", dest: "http://127.0.0.1:8080/blah1/$1" }
- {
route: "/api/svc3/xyz",
@@ -67,7 +67,7 @@ timeout:
Help Options:
-h, --help Show this help message
-
Status
The project is under active development and may have breaking changes till v1 released.