NGINX as a gateway inside Azure Container Apps (ACA) for path-based routing (e.g., /api, /reports, /webapp) without using Azure Front Door

ramprasad.r 60 Reputation points
2025-07-30T08:15:21.99+00:00

I have created a Container Apps Environment named ff***-aca.

Inside it, I have deployed 18 services. These services were previously deployed using ACR images in Kubernetes, but we have now moved to Azure Container Apps (ACA).

I have a subdomain: dev1.*************.com.

I want to expose the APIs like:

  • dev1.********.com/api
  • dev1.**********.com/reports
  • dev1.**********.com/webapp

Is it possible to expose them under the same subdomain without using Azure Front Door?

Azure Container Apps
Azure Container Apps
An Azure service that provides a general-purpose, serverless container platform.
{count} votes

Accepted answer
  1. Anurag Rohikar 285 Reputation points Microsoft External Staff Moderator
    2025-08-07T18:41:08.14+00:00

    Hello ramprasad.r, Thanks for reaching out on Microsoft Q&A and really appreciate your patience while we looked into this.

    YES, you can do this by deploying a dedicated NGINX container app that acts as a reverse proxy to all your other services inside the same ACA environment.

    The Solution: NGINX as a Reverse Proxy
    The recommended solution is to deploy a dedicated NGINX container app that acts as a reverse proxy for all your other services within the same ACA environment.
    Steps:

    1.Deploy NGINX as a Container App:

    • Deploy a new container app using the nginx image.
    • Enable ingress on this NGINX app and set it to external.
    • Bind your custom domain dev1.*********.to this specific NGINX container app. You will need to create a DNS record (typically a CNAME) pointing to the NGINX app's FQDN.
    • Optionally, use Azure File share to mount a persistent configuration file for easier updates.

    2.NGINX Configuration (nginx.conf):

    • Create a configuration file to define your path-based routing rules. The proxy_pass directive will route traffic to the internal FQDNs of your other services.
    • Example nginx.conf:
        server {
            listen 80;
            server_name dev1.*********.com;
            location /api/ {
                proxy_pass http://api-service.internal:80/;
            }
            location /reports/ {
                proxy_pass http://reports-service.internal:80/;
            }
            location /webapp/ {
                proxy_pass http://webapp-service.internal:80/;
            }
        }
        
      
    • The. internal suffix is used to address other container apps within the same ACA environment, regardless of their public ingress status.

    3.Disable External Ingress on Other Services:

    • For your 18 other services (e.g., api-service, reports-service), set their ingress to internal. This is a critical step to ensure they are not publicly accessible and that all traffic is funneled through your NGINX proxy.

    4.Custom Domain and TLS:

    • Custom Domain Binding: The custom domain dev1.*********.com should be bound only to the NGINX container app.
    • TLS Support: You can use Azure's managed certificates to handle TLS termination for the custom domain. This is the simplest way to secure the connection between the client and the NGINX gateway.

    Official Documentation:

    Let me know if this helps. Happy to assist further. Thank You!

    You found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. ramprasad.r 60 Reputation points
    2025-08-12T05:02:06.45+00:00

    Thanks for the Clarification

    1 person found this answer helpful.

Your answer

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