Using mod_proxy to NodeJs application running on same server

Added by Rahul Shinde over 1 year ago

I have node Js server running on same machine as the lighttpd. trying to use mod_proxy to reverse proxy to it but getting below error.

2021-05-06 10:08:55: (gw_backend.c.914) gw - found a host 127.0.0.1 8080
2021-05-06 10:08:55: (gw_backend.c.236) establishing connection failed: Permission denied socket: tcp:127.0.0.1:8080
2021-05-06 10:08:55: (gw_backend.c.301) released proc: pid: 0 socket: tcp:127.0.0.1:8080 load: 0
2021-05-06 10:08:55: (gw_backend.c.939) all handlers for /myapp? on are down.
2021-05-06 10:08:57: (gw_backend.c.315) gw-server re-enabled: tcp:127.0.0.1:8080 127.0.0.1 8080

my proxy config is: #######################################################
server.modules += ( "mod_proxy" )

proxy.balance = "fair"

$HTTP["url"] =~ "^/myapp" {
proxy.server = ("" =>
(
(
"host" => "127.0.0.1",
"port" => 8080
)
)
)
proxy.header = ( "upgrade" => "enable" )
}

#################################################

Any help is appreciated.