API 404 on Nginx

General discussion of Mantis.

Moderators: Developer, Contributor

Post Reply
mack
Posts: 1
Joined: 03 Apr 2019, 15:51

API 404 on Nginx

Post by mack »

I've been trying to get the rewriting correct on a server with nginx. Mantisbt is in a subdirectory /dev/. Has anyone gotten the api to work on nginx?


Thanks!
Wowik
Posts: 1
Joined: 06 Nov 2019, 07:25

Re: API 404 on Nginx

Post by Wowik »

Here point is that API requests go to URI like this ....api/soap/mantisconnect.php/mc_issue_get
And I think nginx is configured to use PHP-FPM with usual directive
location ~ \.php$ {
...
}
So, API requests do not go to PHP-FPM but nginx tries to process them as usual files and nginx have this kind of errors in errorlog
"/var/www/mantis/api/soap/mantisconnect.php/mc_issue_get" failed (20: Not a directory)

To solve this I've created additional location with same content as location for PHP-files:
location /api/soap {
...
}
This location block also can be used for security by limiting access to it by IP address for example.
Post Reply