I've been struggling with setting up nginx as a reverse proxy.
What I want to achieve is:
- Server 1 sends a POST request to: http://1.2.3.4:60009/pass (NGINX server)
- the NGINX Server passes it on to Server 2: http://1.12.13.14:60009/destination/
- 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!