Skip to content

Instantly share code, notes, and snippets.

@gtt116
Created August 25, 2020 11:10
Show Gist options
  • Save gtt116/8c1d416d7817ccf6453de47a5dbab5bb to your computer and use it in GitHub Desktop.
Save gtt116/8c1d416d7817ccf6453de47a5dbab5bb to your computer and use it in GitHub Desktop.
the configuration to set prometheus behind nginx
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
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