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

467
Visualizações
How can I restrict access to allow everything within a VPC (in AWS) through a public nginx reverse proxy?

I have a service running inside a VPC that is exposed through nginx (also on a server within the VPC), since there are http(s) configurations needed which nginx handles. I want to allow that service to be reached only by servers in the same VPC - right now that's done through hardcoding ips with:

allow <elastic ip>;
allow <specific ip>;
allow <specific ip>;
...
deny all;

The Elastic IP (which is at vpc scope) seems to allow only instances which don't have their own public ip. I've also tried allowing the vpc and subnet CIDR blocks, which I'm assuming don't help since they are internal.

How can I get a general public CIDR for a private VPC? Is it possible? Am I going about this the wrong way?

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

It sounds like you should use a Security Group.

A security group is like a firewall around every individual Amazon EC2 instance. It controls what ports are accessible from what CIDR range.

Let's say you have an EC2 instance running a service on port 80, and you only want it accessible to other instances in the VPC. You would simply configure the security group to only allow Inbound connections on port 80 from the CIDR range of the VPC. This would use the private IP addresses, since that's where the traffic is coming from.

Let's go one step better... let's say you only want specific instances to be able to communicate. You would:

  • Create a Security Group on the instances permitted to access the web server (let's call it App-SG)
  • Create a Security Group on the instance with the web server (let's call it Web-SG)
  • Configured Web-SG to allow Inbound connections on port 80 from App-SG

That is, the security group specifically references another security group. This will allow inbound connections from any EC2 instance that has the App-SG associated with it.

None of the above requires an Elastic IP address. Only public-facing resource require a public IP address. It is quite common to only expose a Load Balancer and to keep everything else 'private'.

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