Skip to content
This repository has been archived by the owner on Jun 2, 2023. It is now read-only.

Fix #2 - PLTFRS-8559 - Use port 8080 for health check #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 26 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,42 +1,40 @@
Pointsman
================
# Pointsman

> Simple haproxy docker image redirecting HTTP => HTTPS behind an AWS ELB

Usage
-----
## Usage

`docker run -p 8080:8080 -p 8081:8081 -e HEALTH_CHECK_URI=/check -e FRONTEND_PORT=8080 -e BACKEND_HOST=172.17.0.1 -e BACKEND_PORT=3000 --name pointsman airvantage/pointsman`

Binds your ELB HTTP and HTTPS listeners on `FRONTEND_PORT` and your backend with `BACKEND_HOST` and `BACKEND_PORT`. We also open `:8081` port for the ELB health check on URI `HEALTH_CHECK_URI`.

Binds your ELB HTTP and HTTPS listeners on `FRONTEND_PORT` and your backend with `BACKEND_HOST` and `BACKEND_PORT`. We also open `:8081` port for the ELB health check on URI `HEALTH_CHECK_URI`.

```
--> HTTPS HTTP
| | |
| v v
----------------|----[:443]----[:80]----
ELB | | | | |
| healthcheck | |_ _ | |
| /check | | | |
| | | | | |
|-------|--------|----------|--|---------|
| | v v
----[:8081]-----|--------[:8080]--------
| | | | |
EC2 | | --- No - HTTPS? |
| | | |
| | frontend |
| | | |
| ------ > /check [:3000] |
| backend |
|________________________________________|

--> HTTPS HTTP
| | |
| v v
-------|----[:443]----[:80]--------
ELB | | | | |
| | |_ _ | |
| | | | |
| | | | |
|-------|---------|--|--------------|
| v v
-------|--------[:8080]------------
| | | |
EC2 | --- No - HTTPS |
| or |
| HTTP /check ? |
| | |
| frontend |
| | |
| [:3000] |
| backend |
|___________________________________|

```

See `haproxy.cfg` file for more details.

License
-------
## License

MIT © [Sierra Wireless](http://wwww.sierrawireless.com)
12 changes: 3 additions & 9 deletions haproxy.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,16 @@ defaults
timeout client 1m
timeout server 1m

frontend check
mode http
bind *:8081
acl check path "$HEALTH_CHECK_URI"
use_backend www-backend if check


frontend http
mode http
bind *:$FRONTEND_PORT

acl check path "$HEALTH_CHECK_URI"
acl http hdr(X-Forwarded-Proto) http
acl https hdr(X-Forwarded-Proto) https

redirect scheme https code 301 if http
use_backend www-backend if https
redirect scheme https code 301 unless check or https
use_backend www-backend if https or check

backend www-backend
mode http
Expand Down