So, I got my OSTicket installation going in my VPS that runs cloudpanel. At first everything seems to work Ok, but the I realize that I can't upload images. Also, there are some modal that instead of showing up open a window that seems to be the create user screen. I serached through forums and found several questions that were related but none seemed to work. After several ours of testing and researching (with AI assistance), I found the solution. It was related with the configuration of nginx. I will leave here the info regarding the source of the problem and the solution, maybe it will be helpful for someone in the future.
Nginx Configuration Template Missing PATH_INFO Support for osTicket
Issue:
The default Nginx configuration template causes osTicket to fail when uploading and retrieving file attachments. Files upload successfully (302 redirect) but cannot be retrieved afterward (404 error).
Root Cause:
osTicket uses PATH_INFO URLs for critical functionality:
/file.php/123/filename.png (file retrieval)
/scp/ajax.php/draft/attach/upload (AJAX operations)
In these URLs:
/file.php is the actual PHP script
/123/filename.png is additional routing information (PATH_INFO) that PHP needs
The generic location ~ .php$ block in the template processes PHP files but doesn't pass PATH_INFO to PHP-FPM. When a request like /file.php/123/filename.png arrives:
Nginx matches /file.php
Discards the /123/filename.png portion
PHP never receives this critical routing information
osTicket can't identify which file to serve → 404
Solution Required:
Add specific location blocks with PATH_INFO support in the corresponding sitees-available .conf nginx file:
# File attachment retrieval
location ~ ^/(scp/)?file\.php {
fastcgi_pass 127.0.0.1:{{php_fpm_port}};
include fastcgi_params;
fastcgi_split_path_info ^(.*\.php)(/.+)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param HTTPS "on";
fastcgi_param SERVER_PORT 443;
# ... other params
}
# AJAX operations
location ~ ^/scp/ajax\.php {
fastcgi_pass 127.0.0.1:{{php_fpm_port}};
include fastcgi_params;
fastcgi_split_path_info ^(/scp/ajax\.php)(/.+)$;
fastcgi_param SCRIPT_FILENAME $document_root/scp/ajax.php;
fastcgi_param PATH_INFO $fastcgi_path_info;
# ... other params
}
Key directives:
fastcgi_split_path_info - Splits URL into script name and PATH_INFO
fastcgi_param PATH_INFO - Passes the routing information to PHP
Impact:
Without this configuration, osTicket appears to work but fails on:
File attachment uploads/downloads
AJAX-based features (autocomplete, drafts, etc.)
API endpoints (if used)
I hope this is useful for someone!