Created
August 25, 2020 11:10
-
-
Save gtt116/8c1d416d7817ccf6453de47a5dbab5bb to your computer and use it in GitHub Desktop.
the configuration to set prometheus behind nginx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "2" | |
services: | |
prom: | |
image: prom/prometheus:v2.20.1 | |
volumes: | |
- /data/prometheus:/prometheus | |
- ./prometheus.yml:/etc/prometheus/prometheus.yml | |
- ./inner_configs:/etc/prometheus/inner_configs | |
- ./gde_configs:/etc/prometheus/gde_configs | |
user: root | |
command: | |
- '--storage.tsdb.retention.time=5y' | |
- '--config.file=/etc/prometheus/prometheus.yml' | |
- '--storage.tsdb.path=/prometheus' | |
- '--web.console.libraries=/usr/share/prometheus/console_libraries' | |
- '--web.console.templates=/usr/share/prometheus/consoles' | |
- '--web.external-url=/_prom/' | |
network_mode: host |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
# prometheus | |
location /_prom/ { | |
proxy_pass http://127.0.0.1:9090; | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment