Trouble deploying uvicorn backend for NextJS app

Hey everyone!

I’m pretty new to web dev, so this could be an incredibly stupid problem.

I’m having some issues deploying a Dockerfile app. My NextJS frontend loads just fine on, but the requests to my uvicorn backend aren’t going through (my web console is showing net::ERR_CONNECTION_RESET). My fly.toml is as follows:

# fly.toml file generated for chat-twitter on 2023-04-13T10:44:35-05:00

app = "chat-twitter"
kill_signal = "SIGINT"
kill_timeout = 5
primary_region = "dfw"

  web = "npm run start"
  backend = "uvicorn backend.main:app --host --port 8000"

  protocol = "tcp"
  internal_port = 8080
  processes = ["web"]

    port = 80
    handlers = ["http"]
    force_https = true

    port = 443
    handlers = ["tls", "http"]
    type = "connections"
    hard_limit = 25
    soft_limit = 20

Is this some sort of issue with SSL/TLS? I’m at a loss.

I’m not sure why you’re getting connection reset, but it’s not possible to route HTTP requests like this to two process groups in an app. The easiest thing to do here would be to create two apps, one for your frontend and one for your backend.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.