Explore documentation
Monitoring private networks
To monitor HTTP endpoints on private networks, you can use an HTTP proxy like Squid with basic authentication. This allows Better Stack Uptime to securely access your internal services without exposing them directly to the internet.
Squid + Basic auth (htpasswd) in one container
This setup runs Squid and its authentication mechanism within a single Docker container for simplicity.
1) Create files on the host
Create a folder, for example squid/, with the following files:
Create an htpasswd-style file. The easiest way to generate a password entry is using a temporary Docker container:
Take the output (it will look similar to user1:$2y$...) and put it into the squid/passwords file. Each user should be on a new line.
2) Run Squid with Docker Compose
Create a docker-compose.yml file in the same directory as your squid/ folder:
Start the Squid proxy:
3) Test the proxy
You can test the proxy functionality using curl:
For browsers or other clients, configure the proxy settings:
- Proxy host:
your-host(the IP address or hostname where your Docker container is running) - Proxy port:
3128 - Username/password: The
user1/pass1credentials you set up.
Configure Better Stack Uptime checks
Once your Squid proxy is running and accessible, you can configure your HTTP keyword checks in Better Stack Uptime to use it.
When creating or editing an HTTP keyword monitor:
- Scroll down to Advanced settings.
- In the Proxy Host and Proxy Port fields, enter the host for your proxy without the URL schema, optionally including authentication:
user1:pass1@proxyhostand3128. Replaceuser1andpass1with your proxy credentials, andproxyhostwith the IP address or hostname of your Squid proxy server. - In the URL to monitor field, enter the internal HTTP endpoint you wish to monitor, for example:
http://internal-ip:80/
This setup routes your Uptime checks through the authenticated Squid proxy, allowing you to monitor internal HTTP endpoints securely.