Finally works my Osticket 1.17 + Ubuntu 20.04 + Nginx + PHP 8.1
First disable cgi.fix_pathinfo in /etc/php/8.1/php.ini
cgi.fix_pathinfo=0
My site configuratio in nginx:
server {
root /var/www/osticket;
index index.php index.html;
server_name suporte.company.cloud suporte.company.com.br;
if ($request_uri ~ "^/api(/[^\?]+)") {
set $path_info $1;
}
location ~ ^/api/(?:tickets|tasks|auth).*$ {
try_files $uri $uri/ /api/http.php?$query_string;
}
if ($request_uri ~ "^/scp/.*\.php(/[^\?]+)") {
set $path_info $1;
}
location ~ ^/scp/ajax.php/.*$ {
try_files $uri $uri/ /scp/ajax.php?$query_string;
}
location / {
try_files $uri $uri/ /index.php;
}
# Enable gzip
gzip on;
gzip_min_length 1000;
gzip_types text/plain application/x-javascript text/xml text/css application/xml;
location ~ \.(php|phar)(/.*)?$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php8.1-fpm.sock;
include fastcgi_params;
fastcgi_param PATH_INFO $path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_read_timeout 300;
}
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/osticket.company.cloud/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/osticket.company.cloud/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
if ($host = suporte.company.cloud) {
return 301 https://$host$request_uri;
} # managed by Certbot
if ($host = suporte.company.com.br) {
return 301 https://$host$request_uri;
} # managed by Certbot
server_name suporte.company.cloud suporte.company.com.br;
listen 80;
return 404; # managed by Certbot
}
After that I restarted php-fpm and nginx. Configure the Oauth2 plugin following instructions and work