@ Lyk37858 I am evaluating suiteCRM with nginx, this is something that is working for us with SuiteCRM version 8.0.
Basically, there is a special case for /api/
and everything is either tested for existence (so it gets sent by nginx) or forced through /index.php
over fastcgi if necessary.
location ~ ^/api/ {
index index.php;
try_files $uri @rewrite_api;
}
location / {
index index.php;
try_files $uri @rewrite_ep;
}
location ~ [^/]\.php(/.*)?$ {
fastcgi_split_path_info ^(.+\.php)(/.*)$;
if (!-f $document_root$fastcgi_script_name) {
return 404;
}
# Mitigate https://httpoxy.org/ vulnerabilities
fastcgi_param HTTP_PROXY "";
fastcgi_pass unix:/var/run/php-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_script_name;
fastcgi_param PHP_SELF $document_root$fastcgi_script_name;
}
location @rewrite_api {
rewrite ^/api/(.*)$ /index.php/$1 last;
}
location @rewrite_ep {
rewrite ^/(.*)$ /index.php/$1 last;
}