I would like to pass certain parameters to nodejs over nginx.
While I still used fastcgi, I could do that this way:
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_script_name;
And now I'm basically searching the exact same functionality, for node.js
This would be my current configuration:
server {
# ... other stuff ...
location / {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-Nginx-Proxy true;
proxy_pass http://node;
proxy_redirect off;
# pass any parameter here
}
}
upstream node {
server 127.0.0.1:8080;
}
How can I accomplish that? - And, how can I read the passed value in node.js?