API 404 on Nginx

General discussion of Mantis.

Moderators: Developer, Contributor

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

API 404 on Nginx

Post by mack » Apr 03, 2019 10:57 am

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: Nov 06, 2019 2:25 am

Re: API 404 on Nginx

Post by Wowik » Nov 06, 2019 3:30 am

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