{"id":26029170,"url":"https://github.com/runejuhl/haproxy-map-demo","last_synced_at":"2026-05-15T01:32:22.649Z","repository":{"id":142815247,"uuid":"221899407","full_name":"runejuhl/haproxy-map-demo","owner":"runejuhl","description":"Using Haproxy maps to select backend, force HTTPS and set HSTS header","archived":false,"fork":false,"pushed_at":"2020-01-06T21:19:21.000Z","size":184,"stargazers_count":1,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-04-24T08:43:43.561Z","etag":null,"topics":["acl","docker","haproxy","haproxy-configuration","haproxy-docker"],"latest_commit_sha":null,"homepage":null,"language":"Shell","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/runejuhl.png","metadata":{"files":{"readme":"README.org","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,"zenodo":null}},"created_at":"2019-11-15T10:20:36.000Z","updated_at":"2024-07-11T02:15:38.000Z","dependencies_parsed_at":"2023-04-06T00:33:36.623Z","dependency_job_id":null,"html_url":"https://github.com/runejuhl/haproxy-map-demo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/runejuhl/haproxy-map-demo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/runejuhl%2Fhaproxy-map-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/runejuhl%2Fhaproxy-map-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/runejuhl%2Fhaproxy-map-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/runejuhl%2Fhaproxy-map-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/runejuhl","download_url":"https://codeload.github.com/runejuhl/haproxy-map-demo/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/runejuhl%2Fhaproxy-map-demo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33050181,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T13:14:54.681Z","status":"online","status_checked_at":"2026-05-14T02:00:06.663Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["acl","docker","haproxy","haproxy-configuration","haproxy-docker"],"created_at":"2025-03-06T17:31:11.240Z","updated_at":"2026-05-15T01:32:22.628Z","avatar_url":"https://github.com/runejuhl.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"* Using Haproxy maps to select backend, force HTTPS and set HSTS header\n\nIt's possible to use string maps to simplify Haproxy configuration files. Map\nfiles are read on startup and its values stored in a tree for fast lookups.\n\nThis example uses map files to\n\n+ select backend\n+ force redirect to HTTPS based on domain\n+ set HSTS header\n\n** Example\n\n#+BEGIN_SRC sh\n  ./test.sh\n#+END_SRC\n\n#+BEGIN_EXAMPLE\n  --------------------------------------------------------------------------------\n  $ curl -siH Host: hello.example.org http://localhost:8080\n\n  HTTP/1.1 200 OK\r\n  Date: Fri, 15 Nov 2019 09:33:53 GMT\r\n  Content-Type: text/plain\r\n  Content-Length: 7\r\n  Request-Header-Host: hello.example.org\r\n  Request-Backend-Found: be_hello\r\n  \r\n  hello!\n  --------------------------------------------------------------------------------\n  --------------------------------------------------------------------------------\n  $ curl -skiH Host: hello.example.org https://localhost:8443\n\n  HTTP/1.1 200 OK\r\n  Date: Fri, 15 Nov 2019 09:33:53 GMT\r\n  Content-Type: text/plain\r\n  Content-Length: 7\r\n  Request-Header-Host: hello.example.org\r\n  Request-Backend-Found: be_hello\r\n  Strict-Transport-Security: include_subdomains; preload; max-age=31536000;\r\n  \r\n  hello!\n  --------------------------------------------------------------------------------\n  --------------------------------------------------------------------------------\n  $ curl -siH Host: world.example.org http://localhost:8080\n\n  HTTP/1.1 302 Found\r\n  Cache-Control: no-cache\r\n  Content-length: 0\r\n  Location: https://world.example.org/\r\n  \r\n  --------------------------------------------------------------------------------\n  --------------------------------------------------------------------------------\n  $ curl -skiH Host: world.example.org https://localhost:8443\n\n  HTTP/1.1 200 OK\r\n  Date: Fri, 15 Nov 2019 09:33:53 GMT\r\n  Content-Type: text/plain\r\n  Content-Length: 7\r\n  Request-Header-Host: world.example.org\r\n  Request-Backend-Found: be_world\r\n  \r\n  world!\n  --------------------------------------------------------------------------------\n#+END_EXAMPLE\n\n** Stats\nThe stats page can be accessed on [[http://localhost:63661/haproxy?stats]].\n\n#+CAPTION: Example HAProxy stats page after running ~siege~\n\n[[./haproxy-stats.png]]\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frunejuhl%2Fhaproxy-map-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frunejuhl%2Fhaproxy-map-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frunejuhl%2Fhaproxy-map-demo/lists"}