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

325
Visualizações
Nginx proxy_reverse for docker container

I am currently trying to deploy my app backend as Docker container with exposed ports to my root server.

If I am trying to curl the backend with http://example.com:3000 I get an timeout, if I try it through nginx (view config underneath) I get an empty response (curl: (52) Empty reply from server).

server {
  listen 443 ssl;
  server_name www.example.com example.com;
  client_max_body_size 50m;
  ssl_certificate ... # managed by Certbot
  ssl_certificate_key ... # managed by Certbot

  location /backend/ {
    proxy_pass http://localhost:3000/; 
  }
}

However if I try to curl it from the server itself I have no problems.

Here is the relevant output of the docker ps command:

COMMAND                  CREATED             STATUS                  PORTS                     NAMES
"node dist/server.js"    9 minutes ago       Up 8 minutes            0.0.0.0:9100->3000/tcp    backend

Curl expected (works when running on root server):

$ curl http://localhost:3000

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Error</title>
</head>
<body>
<pre>Cannot GET /</pre>
</body>
</html>
over 4 years ago · Santiago Trujillo
2 Respostas
Responde à pergunta

0

You nginx is running ssl (port 443), so your curl should be:

curl -i https://example.com/backend/.

dont specify any backend port.

over 4 years ago · Santiago Trujillo Relatório

0

The problem was iptables on my server. Some rules were deleted resulting in a violated Docker configuration.

A simple sudo service docker stop was the trick.

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