Do not use localhost in checks

This commit is contained in:
Manuel de Brito Fontes 2017-11-02 17:04:04 -03:00
parent 21cb993874
commit 248d31d6c6
2 changed files with 3 additions and 3 deletions

View file

@ -734,7 +734,7 @@ func (n NGINXController) Name() string {
// Check returns if the nginx healthz endpoint is returning ok (status code 200)
func (n NGINXController) Check(_ *http.Request) error {
res, err := http.Get(fmt.Sprintf("http://localhost:%v%v", n.ports.Status, ngxHealthPath))
res, err := http.Get(fmt.Sprintf("http://0.0.0.0:%v%v", n.ports.Status, ngxHealthPath))
if err != nil {
return err
}

View file

@ -144,7 +144,7 @@ func (bit BoolToFloat64) UnmarshalJSON(data []byte) error {
}
func getNginxStatus(port int, path string) (*basicStatus, error) {
url := fmt.Sprintf("http://localhost:%v%v", port, path)
url := fmt.Sprintf("http://0.0.0.0:%v%v", port, path)
glog.V(3).Infof("start scraping url: %v", url)
data, err := httpBody(url)
@ -175,7 +175,7 @@ func httpBody(url string) ([]byte, error) {
}
func getNginxVtsMetrics(port int, path string) (*vts, error) {
url := fmt.Sprintf("http://localhost:%v%v", port, path)
url := fmt.Sprintf("http://0.0.0.0:%v%v", port, path)
glog.V(3).Infof("start scraping url: %v", url)
data, err := httpBody(url)