{"id":26648997,"url":"https://github.com/joobypm/rev-proxy-bench","last_synced_at":"2026-04-19T13:32:05.226Z","repository":{"id":283854692,"uuid":"953099971","full_name":"JoobyPM/rev-proxy-bench","owner":"JoobyPM","description":"A minimal Docker Compose setup to compare HAProxy, Nginx, and Traefik as reverse proxies over HTTPS, each fronting the same simple test service (`http-echo`)","archived":false,"fork":false,"pushed_at":"2025-03-22T16:10:55.000Z","size":492,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-22T16:32:17.760Z","etag":null,"topics":["docker","docker-compose","haproxy","nginx","traefik"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JoobyPM.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-22T15:14:31.000Z","updated_at":"2025-03-22T16:10:58.000Z","dependencies_parsed_at":"2025-03-22T16:43:27.192Z","dependency_job_id":null,"html_url":"https://github.com/JoobyPM/rev-proxy-bench","commit_stats":null,"previous_names":["joobypm/rev-proxy-bench"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JoobyPM%2Frev-proxy-bench","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JoobyPM%2Frev-proxy-bench/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JoobyPM%2Frev-proxy-bench/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JoobyPM%2Frev-proxy-bench/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JoobyPM","download_url":"https://codeload.github.com/JoobyPM/rev-proxy-bench/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245377954,"owners_count":20605375,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","docker-compose","haproxy","nginx","traefik"],"created_at":"2025-03-25T00:47:35.310Z","updated_at":"2026-04-19T13:32:05.181Z","avatar_url":"https://github.com/JoobyPM.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\nA minimal Docker Compose setup to compare **HAProxy**, **Nginx**, and **Traefik** as reverse proxies over HTTPS, each fronting the same simple test service (`http-echo`).\n\n## 1. Certificate \u0026 Key Setup\n\n1. Generate a self-signed cert and key:\n   ```bash\n   openssl req -x509 -nodes -days 365 \\\n       -subj \"/CN=rev-proxy.test.lab\" \\\n       -newkey rsa:2048 \\\n       -keyout rev-proxy.test.lab.key \\\n       -out rev-proxy.test.lab.crt\n   ```\n2. Put `rev-proxy.test.lab.crt` and `rev-proxy.test.lab.key` in `./certs/`.\n3. For **HAProxy**, also concatenate into a `.pem`:\n   ```bash\n   cat rev-proxy.test.lab.crt rev-proxy.test.lab.key \u003e rev-proxy.test.lab.pem\n   ```\n   Place it in `./certs/` too.\n\n4. Add to your `/etc/hosts` (or equivalent):\n   ```\n   127.0.0.1 rev-proxy.test.lab\n   ```\n   *(Adjust IP if Docker is remote.)*\n\n5. (Optional) Trust the certificate locally to get a “green lock” in your browser.\n\n### 1.1 HAProxy Requires a Single `.pem` File\n\nHAProxy needs the certificate and key **concatenated**:\n\n```bash\ncat rev-proxy.test.lab.crt rev-proxy.test.lab.key \u003e rev-proxy.test.lab.pem\n```\n\nSo you will end up with:\n\n- `rev-proxy.test.lab.crt`\n- `rev-proxy.test.lab.key`\n- `rev-proxy.test.lab.pem` (for HAProxy)\n\nPut them all in a local `certs/` folder (or whichever folder you prefer). Example structure:\n\n```\n.\n├── docker-compose.yml\n├── haproxy.cfg\n├── nginx.conf\n├── traefik_dynamic.yaml\n└── certs\n    ├── rev-proxy.test.lab.crt\n    ├── rev-proxy.test.lab.key\n    └── rev-proxy.test.lab.pem\n```\n\n### 1.2 “Green Lock” on macOS\n\n- To avoid “Not Secure”/warning messages in your browser, you must **trust** the self-signed certificate or use a local CA approach.  \n- Easiest is to double-click the `.crt` file, open Keychain Access, and set “Always Trust” under **Trust**. Your browser should then show the normal lock icon (though you may need to restart your browser).\n\nBelow is an **SSL-enabled** Docker Compose setup that:\n\n1. Uses the same **basic test-service** as before (HashiCorp’s `http-echo`).\n2. Adds SSL/TLS (with a self-signed certificate) for each reverse proxy:\n   - **HAProxy**\n   - **Nginx**\n   - **Traefik**\n\nWe’ll bind them on port **443** instead of **80**.  \nYou can place **`rev-proxy.test.lab`** in your `/etc/hosts` to point to your Docker host, e.g.:\n```\n127.0.0.1  rev-proxy.test.lab\n```\n*(Adjust the IP to match your Docker host if it’s remote.)*\n\nThen you can test via `curl -k https://rev-proxy.test.lab/` or a browser (`Safari` on macOS), ignoring the self-signed warnings.\n\n## 2. Commands\n\n### 2.1 Start HAProxy\n```bash\ndocker compose --profile haproxy up -d\ndocker compose logs haproxy\ncurl -k https://rev-proxy.test.lab/\ndocker compose --profile haproxy down\n```\n\n### 2.2 Start Nginx\n```bash\ndocker compose --profile nginx up -d\ndocker compose logs nginx\ncurl -k https://rev-proxy.test.lab/\ndocker compose --profile nginx down\n```\n\n### 2.3 Start Traefik\n```bash\ndocker compose --profile traefik up -d\ndocker compose logs traefik\ncurl -k https://rev-proxy.test.lab/\ndocker compose --profile traefik down\n```\n\n### 2.4 Run k6 Test (any proxy running)\n```bash\nK6_WEB_DASHBOARD=true \\\nk6 run --insecure-skip-tls-verify ramp-test.js\n```\n\n## 3. Test Results\n\n| Reverse Proxy | Max (ms) | p95 (ms) | Max RPS (before p95\u003e5ms)  | Max RPS  |\n|---------------|----------|----------|---------------------------|----------|\n| **Traefik**   | 88.47    | 24.44    | 15,770                    | 17,180   |\n| **HAProxy**   | 109      | 6        | 34,030                    | 36,080   |\n| **Nginx**     | 86.52    | 5.63     | 35,160                    | 39,570   |\n\n\u003e Each proxy is using port **443** with your self-signed certificate. Adjust your `/etc/hosts` or DNS as needed, then benchmark or load-test however you like.\n\n### 3.1 Detailed Results\nFor detailed test results and analysis of each reverse proxy, see:\n\n- [HAProxy Results](./report/haproxy.md)\n- [Nginx Results](./report/nginx.md) \n- [Traefik Results](./report/traefik.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoobypm%2Frev-proxy-bench","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoobypm%2Frev-proxy-bench","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoobypm%2Frev-proxy-bench/lists"}