Created
August 13, 2024 05:11
-
-
Save taufiqpsumarna/4a617acbf1699fe5f3e77f12e0ef0951 to your computer and use it in GitHub Desktop.
nginx reverse proxy for prometheus HTTP Basic Auth
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; | |
server_name <YOUR_DOMAIN_NAME>; | |
auth_basic "prometheus auth"; | |
auth_basic_user_file /etc/nginx/.htpasswd_prometheus; | |
location / { | |
proxy_read_timeout 1800s; | |
proxy_connect_timeout 1600s; | |
proxy_pass http://localhost:9090; | |
proxy_http_version 1.1; | |
proxy_set_header Upgrade $http_upgrade; | |
proxy_set_header Connection $connection_upgrade; | |
proxy_set_header Connection "Keep-Alive"; | |
proxy_set_header Proxy-Connection "Keep-Alive"; | |
proxy_redirect off; | |
} | |
location /ready { | |
proxy_pass http://localhost:9090; | |
proxy_http_version 1.1; | |
proxy_set_header Connection "Keep-Alive"; | |
proxy_set_header Proxy-Connection "Keep-Alive"; | |
proxy_redirect off; | |
auth_basic "off"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment