Skip to content

Latest commit

 

History

History
65 lines (40 loc) · 1.46 KB

README.md

File metadata and controls

65 lines (40 loc) · 1.46 KB

pingap

What is Pingap

A reverse proxy like nginx, built on pingora, simple and efficient.

Feature

  • Filter location by host and path
  • static file serve
  • HTTP 1/2 end to end proxy
  • Graceful reload
  • Template for http access log
  • TOML base configuration

Start

Loads all configurations from /opt/proxy and run in the background. Log appends to /opt/proxy/pingap.log.

RUST_LOG=INFO pingap -c=/opt/proxy/pingap.toml -d --log=/opt/proxy/pingap.log

Graceful restart

Validate the configurations, send quit signal to pingap, then start a new process to handle all requests.

RUST_LOG=INFO pingap -c=/opt/proxy/pingap.toml -t \
  && pkill -SIGQUIT pingap \
  && RUST_LOG=INFO pingap -c=/opt/proxy/pingap.toml -d -u --log=/opt/proxy/pingap.log

Config

All toml configurations are as follows pingap.toml.

Proxy step

graph TD;
    start("new request")-->server;

    server -- "host:HostA, Path:/api/*" --> locationA

    server -- "Path:/rest/*"--> locationB

    locationA -- "10.0.0.1:8001" --> upstreamA1 --> response

    locationA -- "10.0.0.2:8001" --> upstreamA2 --> response

    locationB -- "10.0.0.1:8002" --> upstreamB1 --> response

    locationB -- "10.0.0.2:8002" --> upstreamB2 --> response

    response --> stop("logging");
Loading

Rust version

Our current MSRV is 1.74

License

This project is Licensed under Apache License, Version 2.0.