#1 2023-02-16 12:13:23

rdevine
Member
Registered: 2014-02-20
Posts: 43

Multiple TRestServer instances

I'd like to split my interface-based services across multiple TRestServerFullMemory instances in a single TRestHttpServer. I create the TRestHttpServer with an initial TRestServerFullMemory with a root, say "myroot". If I attempt to add a second TRestServerFullMemory with root "myroot/mysubroot" using TRestHttpServer.AddServer it fails because UriMatch comes back with a match, so I guess this root format isn't allowed. I see a couple of redirect options in TRestHttpServer and have also just noticed this: https://blog.synopse.info/?post/2022/12 … -Christmas. What would you recommend for best performance? I'm using nginx as a reverse proxy so I suppose have options there.

Thanks, Bob

Offline

#2 2023-02-16 20:14:10

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,232
Website

Re: Multiple TRestServer instances

Roots should not overlap, by design.

You can just use '/root1' then '/root2' and use TRestHttpServe.Route to change the URI as you need.
It would be of the best performance, and if all TRestServerFullMemory run in the same process, I would not mess configuration with nginx as reverse proxy.

Offline

Board footer

Powered by FluxBB