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

Commit

Permalink
Fix #2 - PLTFRS-8559 - Use port 8080 for health check
Browse files Browse the repository at this point in the history
  • Loading branch information
sgaestel committed Dec 13, 2017
1 parent 6a26eb0 commit 287002f
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 36 deletions.
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)
10 changes: 2 additions & 8 deletions haproxy.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,15 @@ 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
redirect scheme https code 301 unless check or https
use_backend www-backend if https

backend www-backend
Expand Down

0 comments on commit 287002f

Please sign in to comment.