Project

General

Profile

[Solved] Mutiple rest api paths

Added by mike47 about 5 years ago

Hi,

Have bit of a basic gap in understanding. I have several APIs under /api prefix all serviced by a single fcgi backend which I configure as below under doc root /www:

fastcgi.server = (
"/api" =>
( "CommonAPIBackend" =>
(
"mode" => "responder",
"socket" => "/var/run/apid.sock",
"check-local" => "disable",
"docroot" => "/www"
)
)
)

I also have error-intercept disabled, so that I control the responses.

My question is, if I have API paths /api/users, /api/sessions etc... Am I supposed to create those directory structures under /www/api?
If I don't I'm getting 404 error. It does work if the directories are present.

Is this the right way to do this? How do I map a set of REST URI paths to be serviced through a specific fcgi socket without having to create those directory paths?

Thanks for the help.

Mike.


Replies (3)

RE: Mutiple rest api paths - Added by gstrauss about 5 years ago

"check-local" => "disable"

See gw_backend-gateway-server-host-options

I see that you already have that above, so please double-check that config is actually in use. Have you restarted lighttpd since making that config change?

RE: [Solved] Mutiple rest api paths - Added by mike47 about 5 years ago

Wait. I have check-local disabled in the config above. Doesn't that work?

I am using lighttpd-1.4.48.

RE: [Solved] Mutiple rest api paths - Added by gstrauss about 5 years ago

"check-local" => "disable"
should be what you need.

You might try strace on lighttpd and see what is actually being accessed. Is mod_fastcgi loaded in server.modules?
Is the request for /api being handled by mod_fastcgi?

If you create the file under /www/api do the REST request work as expected? Things might not be working the way you think they're working.

    (1-3/3)