Share via

Azure App Service (Linux) – Nginx cannot resolve sidecar container hostname (host not found in upstream)

Tamilarasan Nallairusun 40 Reputation points
2026-02-17T11:27:02.5933333+00:00

Content:

Hello Team,

I am deploying a multi-container setup in Azure App Service (Linux) using the new Main container + Sidecar containers model.

Architecture:

Main container → Nginx (port 80)

Sidecar container → Sails API (port 1337)

Sidecar container → React Admin (port 80 internal)

Sidecar container → React Web (port 80 internal)

All images are stored in Azure Container Registry and successfully pulled by App Service.

Problem:

Nginx fails to start with the following error:

host not found in upstream "web" in /etc/nginx/nginx.conf

And sometimes:

bind() to 0.0.0.0:80 failed (98: Address already in use)

Nginx Configuration:

events {}

http {
    server {
        listen 80;

        location / {
            proxy_pass http://web:80;
        }

        location /admin/ {
            proxy_pass http://admin:80/;
        }

        location /api/ {
            proxy_pass http://api:1337/;
        }
    }
}

Observations:

  • Works perfectly in local Docker Compose
  • Fails only in Azure App Service
  • Using Managed Identity with AcrPull role
  • Only main container exposes port 80

Sidecars do not expose port 80 (except API 1337)

Questions:

In Azure App Service (Linux sidecar model), what is the correct hostname format to reference sidecar containers from the main container?

Are container names automatically prefixed internally?

Is there a recommended way to configure inter-container DNS resolution?

Is Docker Compose networking behavior different from Azure App Service sidecar networking?

Any guidance on correct internal DNS naming or networking configuration would be appreciated.

Thank you.

Azure App Service
Azure App Service

Azure App Service is a service used to create and deploy scalable, mission-critical web apps.

0 comments No comments
{count} votes

Answer accepted by question author
  1. Golla Venkata Pavani 2,340 Reputation points Microsoft External Staff Moderator
    2026-02-17T16:37:50.8466667+00:00

    Hi @Tamilarasan Nallairusun ,

    Thank you for reaching us regarding the issue.

    Azure App Service (Linux) sidecar containers do not provide Docker‑Compose‑style networking or DNS service discovery. Containers run in a shared network namespace, and container names are not resolvable as hostnames. Inter‑container communication must be done via localhost and distinct ports.

    In Azure App Service (Linux sidecar model), what is the correct hostname format to reference sidecar containers from the main container?
    In Azure App Service (Linux) sidecar model, containers do not get separate DNS hostnames and container names (like web or api) cannot be used for routing. All containers share the same network stack, so you should access sidecars using http://localhost:<port>.

    Are container names automatically prefixed internally?
    No, Microsoft does not provide automatic DNS, FQDNs, or name prefixing for sidecar containers. Their names are only deployment identifiers and cannot be resolved internally by Nginx or other applications.

    Is there a recommended way to configure inter-container DNS resolution?
    In sidecar-enabled Azure App Service apps, use one main container and run sidecars on different internal ports, accessing them via localhost. Docker-style networking and WEBSITES_PORT do not apply, as sidecars share the same runtime and networking stack under sitecontainers.

    Why host not found in upstream occurs
    Nginx resolves upstream hostnames during startup, but Azure App Service does not create internal DNS entries for sidecar containers. As a result, hostnames such as web, admin, or api cannot be resolved within the environment.

    Why bind() to 0.0.0.0:80 failed (98: Address already in use) occurs
    In Azure App Service, all containers share one network namespace, so only the main container can use port 80. Sidecars should run on unique ports, like 3000, 3001, and 1337.

    Is Docker Compose networking different from Azure App Service sidecars?
    Unlike Docker Compose, which provides service DNS, container name resolution, and separate networks, Azure App Service sidecars do not support these features. Instead, all sidecar containers share the same localhost with the main container, relying on unique internal ports for communication.

    Reference:
    https://learn.microsoft.com/en-us/azure/app-service/configure-sidecar
    https://learn.microsoft.com/en-us/azure/app-service/tutorial-sidecar?tabs=portal
    https://learn.microsoft.com/en-us/azure/app-service/migrate-sidecar-multi-container-apps

    Kindly let us know if the above comment helps or you need further assistance on this issue.

    Please "accept" if the information helped you. This will help us and others in the community as well.

    1 person found this answer helpful.
    0 comments No comments

Answer accepted by question author
  1. Jose Benjamin Solis Nolasco 7,376 Reputation points
    2026-02-17T13:47:00.0966667+00:00

    Welcome to Microsoft Q&A

    Hello Tamilarasan Nallairusun,

    You have hit the fundamental difference between the Docker Compose (Bridge Network) model and the new App Service Sidecar (Shared Network) model.

    In the new Azure App Service Sidecar model, containers share the same network namespace (similar to a Kubernetes Pod).

    1. Hostname: You cannot use container names (e.g., http://web). You must use http://localhost:<port> or http://127.0.0.1:<port>.
    2. Ports: Because all containers share the same localhost, they cannot all listen on port 80. You must configure your sidecars to listen on unique ports (e.g., 8081, 8082).

    Your error bind() to 0.0.0.0:80 failed occurs because your Main Container (Nginx) and your Sidecars (React/Admin) are all trying to bind to port 80 on the same network interface.

    My advice is follow this guide and update your settings https://www.youtube.com/watch?v=HgSKPqO1WpY

    😊 If my answer helped you resolve your issue, please consider marking it as the correct answer. This helps others in the community find solutions more easily. Thanks

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.