August 2017
Intermediate to advanced
278 pages
8h 53m
English
There's only one main block directive to get our simple test working, with a few key areas.
proxy_pass http://127.0.0.1:3000;
The proxy will forward the connection back to our Express-driven test application, which we configured to listen on port 3000 of the localhost.
proxy_http_version 1.1;
By default, proxied connections back to the Node.js application will be HTTP/1.0 only. Setting this to HTTP/1.1 allows the use of keep-alive, which means the connection between NGINX and the application remains open rather than establishing a new connection every time. On a heavily loaded system, this is much more efficient.
proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade";
The WebSocket protocol uses ...
Read now
Unlock full access