Error redirecting prometheus call with nginx
Why am I getting 404 error after authenticating to the call http://<ip-external>:80
?
I would like when the call was made, he authenticated with username and password, and it was returned after the page of prometheus
docker.compose.yml
version: '3.1'
services:
prometheus:
image: prom/prometheus
container_name: meta_prometheus
user: '0'
volumes:
- /etc/prometheus:/etc/prometheus
- /prometheus/data:/prometheus/data
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus/data'
ports:
- 9090:9090
network_mode: host
nginx.conf
pid /etc/nginx/logs/nginx.pid;
http {
server {
listen 0.0.0.0:80;
location / {
proxy_pass http://localhost:9090/;
auth_basic "Prometheus";
auth_basic_user_file ".htpasswd";
}
}
}
events {
}
returned
Ref: https://www.robustperception.io/adding-basic-auth-to-prometheus-with-nginx
Nginx version: 1.9
OS: Red Hat Enterprise Linux 7.9
Source: Docker Questions