Hi,

Thanks for your help on the segfaults last week. I've now built and
installed NaviServer at HEAD and things are much more stable now.

A knock on effect is our reverse proxy code no longer works. It was a
custom version of your revproxy code which wasn't as up-to-date. So we're
now attempting to rewrite the code to use your revproxy module in full with
the nsf framework.

One issue I'm hitting is that our configuration with 2 virtual servers may
be causing problems with connchan creation.

We have 2 servers configured listening on different ports.
eg.

ns_section "ns/servers"
ns_param   server1 "server1"
ns_param   server2 "server2"

ns_section "ns/server/server1/modules"
ns_param nssock1 nssock.so
ns_param nsssl1 nsssl.so
ns_param nslog nslog.so
ns_param        revproxy        tcl

ns_section "ns/server/server2/modules"
ns_param nsssl2 nsssl.so
ns_param nslog nslog.so
ns_param        revproxy        tcl

ns_section "ns/server/server1/module/nssock1"
ns_param        port           80
....
ns_section "ns/server/server1/module/nsssl1"
ns_param port           443
....
ns_section "ns/server/server2/module/nsssl2"
ns_param port           8443
....

When the request arrives via server1/nsssl1 on port 443 everything seems
fine.

But when the requests comes in on server2/nsssl2 on port 8443, we get the
error:

[18/Dec/2020:16:33:00][28278.7f80e7635700][-socks-] Error: channel "conn46"
does not exist
channel "conn46" does not exist
    while executing
"ns_connchan read $from"
    (procedure "::nsf::procs::revproxy::backendReply" line 10)
    invoked from within
"::revproxy::backendReply -callback {} conn46 conn47
https://localhost:8002/proxy_test.html {-timeout 10.0 -sendtimeout 0.0
-receivetimeout 0.5} 0 r"
(context: connchan proc)

Adding some extra logging, the output of [ns_connchan list],  I see that
the backend connchan is created under server1, where-as the frontend
connchan once detached is under server2.

[18/Dec/2020:16:32:59][28278.7f80c67fc700][-conn:server2:2:1-] Notice:
backendChan opened {conn46 {} 1608309179.838249 nsssl1 172.31.110.244 1417
0 {} {} {}} {conn44 -socks- 1608307531.287067 nsssl1 172.31.110.244 1417 0
{} ::revproxy::backendReply rex}

[18/Dec/2020:16:32:59][28278.7f80c67fc700][-conn:server2:2:1-] Notice:
frontendChan conn47 detached {conn46 {} 1608309179.838249 nsssl1
172.31.110.244 1417 0 {} {} {}} {conn47 {} 1608309179.834903 nsssl2
172.31.110.244 0 0 {} {} {}} {conn44 -socks- 1608307531.287067 nsssl1
172.31.110.244 1417 0 {} ::revproxy::backendReply rex}

What's the best way of controlling the context of the connchan creation?
The immediate way round this I see is splitting the code to create two
separate nsd processes... but not sure if that should be necessary?

Regards,

-- 
*David*
_______________________________________________
naviserver-devel mailing list
naviserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/naviserver-devel

Reply via email to