Skip to content

Commit 621793c

Browse files
committed
Add :8090/nginx_status endpoint for monitoring
1 parent 602c5c7 commit 621793c

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed

README.md

+13
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ $ docker run \
1717
--rm \
1818
--name nginx-basic-auth-proxy \
1919
-p 8080:80 \
20+
-p 8090:8090 \
2021
-e BASIC_AUTH_USERNAME=username \
2122
-e BASIC_AUTH_PASSWORD=password \
2223
-e PROXY_PASS=https://www.google.com \
@@ -37,6 +38,18 @@ $ docker-compose up
3738
# - Password: password
3839
```
3940

41+
### Endpoint for monitoring
42+
43+
`:8090/nginx_status` returns the metrics of Nginx.
44+
45+
```sh-session
46+
$ curl localhost:8090/nginx_status
47+
Active connections: 1
48+
server accepts handled requests
49+
8 8 8
50+
Reading: 0 Writing: 1 Waiting: 0
51+
```
52+
4053
## Environment variables
4154

4255
### Required

docker-compose.yml

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ services:
66
image: quay.io/dtan4/nginx-basic-auth-proxy:latest
77
ports:
88
- 8080:80
9+
- 8090:8090
910
environment:
1011
- BASIC_AUTH_USERNAME=username
1112
- BASIC_AUTH_PASSWORD=password

files/nginx.conf.tmpl

+9
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,13 @@ http {
3030
proxy_set_header Authorization "";
3131
}
3232
}
33+
34+
server {
35+
listen 8090;
36+
37+
location /nginx_status {
38+
stub_status on;
39+
access_log off;
40+
}
41+
}
3342
}

0 commit comments

Comments
 (0)