You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a nodejs server running with http and I want to it to listen to a Unix Domain Socket to bypass the host network stack to a proxy http server, apache2 in case.
It works fine until I make the apache2 server proxy the requests to the nodejs process throught the UDS because when I do that the proxy server returns 503 Service Unavailable. I checked the path for the socket (/tmp/tcu.sock) and it has the same user as the apache2 http proxy server (www-data) and I as root user can use curl (curl -XGET --unix-socket /tmp/tcu.sock http://tcu-api.tcentral.local/ping) to query the nodejs process and get the correct response.
I think it seems to be nodejs related as I runned the netstat --protocol=unix command and I didn't found the nodejs process listening to the socket and I'm sure that the nodejs process is running as I made it managed by systemd.
How I can resolve that?
Thanks for the attention.
The text was updated successfully, but these errors were encountered:
I think I found the problem. I was creating the socket at /tmp folder. It has root user as owner and I think it is that that was blocking apache2 to read/write to it. I created the socket at a folder that has ownership of the apache2 user and it then worked.
Thanks for your attention @gireeshpunathil and sorry for any trouble. Will close the issue as I resolved it.
reinaldorauch
changed the title
Apache2 proxy server throught Unix Domain Socket to Node.JS http server process
[Resolved] Apache2 proxy server throught Unix Domain Socket to Node.JS http server process
May 15, 2018
I have a nodejs server running with http and I want to it to listen to a Unix Domain Socket to bypass the host network stack to a proxy http server, apache2 in case.
It works fine until I make the apache2 server proxy the requests to the nodejs process throught the UDS because when I do that the proxy server returns 503 Service Unavailable. I checked the path for the socket (/tmp/tcu.sock) and it has the same user as the apache2 http proxy server (www-data) and I as root user can use curl (curl -XGET --unix-socket /tmp/tcu.sock http://tcu-api.tcentral.local/ping) to query the nodejs process and get the correct response.
I think it seems to be nodejs related as I runned the netstat --protocol=unix command and I didn't found the nodejs process listening to the socket and I'm sure that the nodejs process is running as I made it managed by systemd.
How I can resolve that?
Thanks for the attention.
The text was updated successfully, but these errors were encountered: