Reverse proxy Azure container app

Please use this template for troubleshooting questions.

I am new to NGINX software.

My issue: **
My reverse proxy from the browser is not found (404)

https://**myappx.mywhite-1234abc.uksouth.azurecontainerapps.io/myapp/

while curl myapp in the concole of my NGINX container works well

**How I encountered the problem:
https://**myappx.mywhite-1234abc.uksouth.azurecontainerapps.io/myapp/ returns 404.

Solutions I’ve tried:

Version of NGINX or NGINX adjacent software: 1.28 stable

Deployment environment:

NGINX 1.28 stable and the app myapp react are docker containers pushed into Azure container registry and and run as Container Apps under the same environment. NGINX has external ingress while myapp has internal ingress.

Here is my nginx.conf:

worker_processes 1;

events {
worker_connections 1024;
}

http {
server_names_hash_max_size 2048;
server_names_hash_bucket_size 128;
include mime.types;
default_type application/octet-stream;

server {
listen 80;
server_name myappx.mywhite-1234abc.uksouth.azurecontainerapps.io;

location / {
  root /usr/share/nginx/html;
  index index.html;    
}

}
server {
listen 3000;
server_name myapp.internal.mywhite-1234abc.uksouth.azurecontainerapps.io;

location /myapp/ {    
  proxy_pass https://myapp.internal.mywhite-1234abc.uksouth.azurecontainerapps.io/;
  proxy_set_header Host $host;
  proxy_ssl_server_name on;
  proxy_set_header X-REAL-IP $remote_addr;
  proxy_http_version 1.1;
}

}
}

Hey @evanp!

You mentioned things work correctly when curling from inside the NGINX container right? If so, I am inclined to think this is an issue with your Azure environment instead of NGINX itself.

The dockerized Azure container, contains cURL and NGINX. cURL can reach the other endpoint but NGINX cannot reach it. It would be usefull if somebody has done installation for NGINX as Reverse proxy and try to compare what is missing from the nginx.conf or another configuration file.

Hi alessandro many thanks for your pointer.

We changed the nginx.conf, server name, and the application to match the response and all works fine.

1 Like

That’s great to hear! :raising_hands:

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