These are chat archives for collectiveaccess/support

May 2018
May 18 2018 10:06

@collectiveaccess Trying to setup CA on an Nginx server instead of Apache2 and having some problems.
When browsing providence as normal everything seems to work, but trying to access service.php sends me to index.php with the error
Errors occurred when trying to access /service.php:
Invalid controller path

Is this a webserver-config error or something else?
I do a try_files in the sites config that sends everything to index.php if it's not found, but I have confirmed that service.php is in the correct place...
location / {
try_files $uri /index.php$is_args$args;

May 18 2018 10:28

Digging deeper it seems I can get the same error on my old Apache2 CA by writing a truly invalid controller path, so I guess service.php is loaded.
And it is not wrong for it to give error when trying to access service.php without specifiying a API path.

Assuming service.php works I tried a few basic API paths.
On my old installation I can do a call to /service.php/browse/ca_objects
And get a nice "Getting results for browses without criteria is not supported" witch is all well and good. But it returns "Invalid controller path" on my new.
/service.php/auth/login does the same.

On my old server I run Providence 1.7 and on the Nginx I run Providence 1.7.6

May 18 2018 12:05
Hmm, it sounds like service.php is losing the rest of the path for some reason
What version of nginx are you running?
(I'll try to create a set up similar to your and reproduce)
May 18 2018 12:35
Downloaded 1.7.5 and it works as it should, so there is something specific with 1.7.6
I am running Ubuntu 18.04 with Nginx version: nginx/1.14.0 (Ubuntu)
I would sugest try service api in any setup and just double check it works
May 18 2018 12:43
oh no, I was mistaken. Hadn't changed my hosts file so I was trying it on the old server... 1.7.5 still gives the same problem on new server
May 18 2018 13:52
Yeah I was going to ask that. 1.7.6 really isn't that different from 1.7.5
May 18 2018 14:02

Here is the complete Nginx site-config I use

It might have something to do with how Nginx passes the request to PHP FPM and something gets lost in translation... But I can't see it.

If all else fails I suppose I have to run Apache2, though I was exited to see if we could get some speed increases with Nginx.

May 18 2018 14:05
No let's make nginx work. I use Apache out of habit, but I really should stop that madness