Welcome! Log In Create A New Profile

Advanced

help with reverse proxy configuration

Posted by nivrozen 
help with reverse proxy configuration
March 30, 2015 11:22AM
Hi Everyone,

i've successfully managed to set up a reverse proxy which receives data via POST requests from clients and forwards them to a NodeJS server for further processing and storing.

now i would like the nginx reverse proxy to return a 200 OK blank response for all of these requests BEFORE forwarding to the nodeJS server. so the clients will receive the response immediately without the need to wait for the backend server to finish the processing.
if i use "return 202;" inside the location directive, the nginx reverse proxy does respond immediately, but never forwards the request to the NodeJS server.

can this be achieved with nginx?
any help would be much appreciated.

this is my current configuration:

server {
listen 80;
server_name test.proxy.com;
root /home/http/root;
}
location ~* /([0-5]|Heartbeat|Tracking) {
#return 202;
proxy_pass http://20.10.10.6:8080;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
more_set_headers 'Access-Control-Allow-Headers: X-Requested-With' 'Access-Control-Allow-Methods: POST, GET, OPTIONS' 'Access-Control-Allow-Origin: http://cors.domain.com';
}

}
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 166
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready