Navigation Menu

Skip to content

Commit

Permalink
Add :8090/nginx_status endpoint for monitoring
Browse files Browse the repository at this point in the history
  • Loading branch information
dtan4 committed Sep 28, 2017
1 parent 602c5c7 commit 621793c
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
13 changes: 13 additions & 0 deletions README.md
Expand Up @@ -17,6 +17,7 @@ $ docker run \
--rm \
--name nginx-basic-auth-proxy \
-p 8080:80 \
-p 8090:8090 \
-e BASIC_AUTH_USERNAME=username \
-e BASIC_AUTH_PASSWORD=password \
-e PROXY_PASS=https://www.google.com \
Expand All @@ -37,6 +38,18 @@ $ docker-compose up
# - Password: password
```

### Endpoint for monitoring

`:8090/nginx_status` returns the metrics of Nginx.

```sh-session
$ curl localhost:8090/nginx_status
Active connections: 1
server accepts handled requests
8 8 8
Reading: 0 Writing: 1 Waiting: 0
```

## Environment variables

### Required
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Expand Up @@ -6,6 +6,7 @@ services:
image: quay.io/dtan4/nginx-basic-auth-proxy:latest
ports:
- 8080:80
- 8090:8090
environment:
- BASIC_AUTH_USERNAME=username
- BASIC_AUTH_PASSWORD=password
Expand Down
9 changes: 9 additions & 0 deletions files/nginx.conf.tmpl
Expand Up @@ -30,4 +30,13 @@ http {
proxy_set_header Authorization "";
}
}

server {
listen 8090;

location /nginx_status {
stub_status on;
access_log off;
}
}
}

0 comments on commit 621793c

Please sign in to comment.