Skip to content

Commit

Permalink
fix: add nginx_status section to run the nginx_exporter correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
Olivier Cervello authored Sep 24, 2021
2 parents 91f24fe + fa16a9d commit 60612fd
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
5 changes: 3 additions & 2 deletions conf/apache.conf
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,9 @@ LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-A

ExtendedStatus On
<Location /server-status>
SetHandler server-status
Require all granted
SetHandler server-status
Require ip 127.0.0.1
Require ip 172.30.0.0/16
</Location>

<Location /cgi>
Expand Down
14 changes: 14 additions & 0 deletions conf/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,13 @@ server {
proxy_pass http://$backend/cgi/display.pl?$request_uri;
}

location /nginx_status {
stub_status;
allow 127.0.0.1; # localhost
allow 172.30.0.0/16; # docker IP range
deny all; # deny all other hosts
}

location /cgi/ {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
Expand Down Expand Up @@ -168,6 +175,13 @@ server {
proxy_pass http://$backend/cgi/display.pl?$request_uri;
}

location /nginx_status {
stub_status;
allow 127.0.0.1; # localhost
allow 172.30.0.0/16; # docker IP range
deny all; # deny all other hosts
}

location /cgi/ {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
Expand Down
7 changes: 7 additions & 0 deletions docker/prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,10 @@ volumes:
external: true
product_images:
external: true

networks:
webnet:
driver: bridge
ipam:
config:
- subnet: 172.30.0.0/16

0 comments on commit 60612fd

Please sign in to comment.