Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

320
Views
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 answers
Answer question

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 Report

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!