Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

345
Visualizações
Service Discovery not working with Route 53 and ECS Nginx container Hosting Angular code

I am having static UI pages making REST api calls to other ECS-Fargate containers. The static pages are hosted again in a container having Nginx. The api calls are not getting resolved by the route 53 DNS service. If I spin up an EC2 instance and use nslookup then the address translation is taking place correctly.

All the containers are in the same subnet and only Nginx-Angular container has a public ip address. I wish to access the Nginx-Angular container over the internet which will make api calls to other ECS Fargate containers. Please advise.

nginx.conf

worker_processes  1;

events {
    worker_connections  1024;
}

http {
    server {
       #listen 80;
       server_name  localhost;
       ssl_certificate /etc/nginx/ssl/nginx.crt;
       ssl_certificate_key /etc/nginx/ssl/nginx.key;

       listen 443 ssl;
       root /usr/share/nginx/html/login-ui;
       index  index.html index.htm;
       include /etc/nginx/mime.types;

       gzip on;
       gzip_min_length 1000;
       gzip_proxied expired no-cache no-store private auth;
       gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript;

       location / {
           try_files $uri $uri/ /index.html;
       }
}
over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

I solved the problem of by keeping the angular & nginx container in the private subnet. I setup an Application Load balancer with having public ip in the public subnet. I route all the traffic from the internet using Nginx reverse proxy mechanism and the requests are resolved by Nginx and forwarded to my API containers using Route53 internal DNS. The browser must send all the requests to an Nginx location only and it should decide where to route the private intranet topic using Route53 internal dns. authenticationservice.local is my DNS entry. Here is my nginx.conf.

worker_processes  1;

events {
    worker_connections  1024;
}

http {
server {
    server_name  localhost;
    resolver 127.0.0.1;
    ssl_certificate /etc/nginx/ssl/nginx.crt;
    ssl_certificate_key /etc/nginx/ssl/nginx.key;

    listen 443 ssl;
    root /usr/share/nginx/html/login-ui;
    index  index.html index.htm;
    include /etc/nginx/mime.types;

    gzip on;
    gzip_min_length 1000;
    gzip_proxied expired no-cache no-store private auth;
    gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript;

    location / {
        try_files $uri $uri/ /index.html;
    }


    location /test/api/ {
            rewrite /test/api/login/ break;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header Host $host;
            proxy_redirect   off;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_pass https://authenticationservice.local:8443/api/login;
    }
  }
}
over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda