1

I've been struggling with setting up nginx as a reverse proxy.

What I want to achieve is:

  1. Server 1 sends a POST request to: http://1.2.3.4:60009/pass (NGINX server)
  2. the NGINX Server passes it on to Server 2: http://1.12.13.14:60009/destination/
  3. Server 2 sends a response through the NGINX server back to Server 1.

Right now the request gets passed through to the end destination but the response doesn't go anywhere.

Here is my site configuration file:

server {
    listen 60009;
    server_name 1.2.3.4;

    access_log /var/log/nginx/60009_access.log;
    error_log /var/log/nginx/60009_error.log;

    location = /favicon.ico { access_log off; log_not_found off; }

    location /pass {
        proxy_pass http://1.12.13.14:60009/destination/;
        proxy_read_timeout 1200;
    }
}

I currently get a 499 error by NGINX.

The servers work with asynchronous requests. Server 1 sends out a connection request, gets proxy_passed by my nginx server and ends at Server 2. Server 2 accepts the request and sends back an acknowledgment response which ends nowhere.

I tried searching for similar problems or solutions, but I couldn't find much. If I'm using the wrong terminology please let me know so that I can correct myself.

Thank you!

0

According to https://stackoverflow.com/a/18410932/6450889 the error code signifies a timeout. I would guess your back-end might take to long to respond or behaves in a non-standard way.

Also, if you haven't done this already, verify the request arrive at your backend (Server 2).

3
  • Hey c11o, thanks for making an account and replying! I can verify that the request does arrive at Server 2. – Tony Kyriakidis Dec 22 '20 at 18:49
  • I was not aware you have three servers at play, I mistakenly changed "sent" to "receive", assuming Server 1 is the one running your nginx. Is there a particular reason for a timeout of 20 minutes (1200 seconds)? – c11o Dec 22 '20 at 22:44
  • No specific reason! This is how it was configured when I started working on this project – Tony Kyriakidis Dec 23 '20 at 8:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.