Page 1 of 1

API 404 on Nginx

Posted: 03 Apr 2019, 15:57
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!

Re: API 404 on Nginx

Posted: 06 Nov 2019, 08:30
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.