Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sometime 404 #847

Open
Leadrive opened this issue Oct 27, 2021 · 1 comment
Open

sometime 404 #847

Leadrive opened this issue Oct 27, 2021 · 1 comment

Comments

@Leadrive
Copy link

I have three ECS, every ECS had install nginx to access the http request.

My http service use nomad to manage. this is the nomad config.

job "httpcard" {
  datacenters = ["dc1"]
  type = "service"

  group "httpcardg" {
    count = 3
    network {
      port "http" {
        static = 8482
        to = 8482
      }
    }

    service {
      name = "httpcards"
      tags = ["urlprefix-/"]
      port = "http"
      check {
        name     = "health"
        type     = "http"
        path     = "/api/card/health"
        interval = "10s"
        timeout  = "2s"
      }
    }

    restart {
      attempts = 2
      interval = "30m"
      delay = "15s"
      mode = "fail"
    }

    task "httpcardt" {
      env {
        REDIS_ADDR = "172.16.0.2:6379"
        REDIS_PASSWORD = "xxxx"
      }
      user = "develop"
      driver = "raw_exec"
      config {
        command = "/develop/http_card/httpCard"
      }
    }
  }
}

I want to use fabio to route the request to my http service http_card, so I set the proxy in nginx.conf.

                location /api/card {
                        proxy_pass http://127.0.0.1:9999/api/card;
                        proxy_set_header X-Real-IP $remote_addr;
                        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                }

/api/card is the URL.

fabio routes will have

1	httpcards	/	http://172.16.0.4:8482/		33.33%
2	httpcards	/	http://172.16.0.2:8482/		33.33%
3	httpcards	/	http://172.16.0.12:8482/		33.33%

fabio sometime can tranfer the http request, sometime report 404

@ketzacoatl
Copy link

@Leadrive does the backend return a 404 in these cases, or only fabio? Can you look at fabio's logs to determine the service health or additional info about what state the services and routes are in?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants