osTicket API returns 404

My YunoHost server

Hardware: VPS in self-hosted Proxmox cluster
YunoHost version: 11.2.3
I have access to my server : Through SSH | through the webadmin |
Are you in a special context or did you perform some particular tweaking on your YunoHost instance ? : no
If yes, please explain:

Description of my issue

I’m trying to use the osTicket API with the Wordpress osTicket plugin.
This uses the /api/tickets.json endpoint. I couldn’t get the plugin to work and it doesn’t seem to log or error, so I have been testing with curl and python.
I had to enable visitor access to osTicket and the osTicket API to allow API key access, but a curl request as documented (curl -d "{}" -H "X-API-Key: xxxxxxx" https://my.server/api/tickets.json) returns a 404.
In the nginx error log I get this: "/usr/share/nginx/htmlapi/http.php/tickets.json" failed (2: No such file or directory), client: 82.69.105.57, server: my.server, request: "POST /api/tickets.json HTTP/2.0", host: "my.server"

The osTicket code has a .htaccess file and this has been adapted to nginx in my.server.d/osticket.conf:

location ~ ^/api/(?!http.php/)(.*) { try_files $uri $uri/ /api/http.php/$1; }

So it looks like the document root isn’t being picked up unless I’m missing something.

Fixed it by putting the ^/api location outside of the root (/) location stanza. I’ll make an issue / pull request on the install script repo.

Ah, my pull request was accepted but there was a semi-colon missing so it breaks the available update. Fixed and posted another pull request if someone can accept it soon.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.