VPS & Nginx
Deploying via VPS with Nginx
Section titled “Deploying via VPS with Nginx”If you are deploying FoxDesk on a clean VPS or dedicated machine, configuring Nginx requires manually routing the Authorization header to PHP-FPM and shielding internal application directories from external web access.
Nginx Configuration (Server Block)
Section titled “Nginx Configuration (Server Block)”In your virtual host configuration block (for example, /etc/nginx/sites-available/helpdesk.conf), include the following structure to handle the front-controller pattern and secure internal paths:
server { listen 443 ssl; server_name helpdesk.example.com; root /var/www/helpdesk; index index.php;
# Route all requests through index.php location / { try_files $uri $uri/ /index.php?$query_string; }
# Pass PHP scripts to FastCGI server location ~ \.php$ { fastcgi_pass unix:/var/run/php/php8.1-fpm.sock; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params;
# Mandatory: Pass Authorization header to allow Bearer API auth fastcgi_param HTTP_AUTHORIZATION $http_authorization; }
# Block direct access to core internal directories location ~ ^/(backups|bin|includes)/ { deny all; }
# Prevent potential malicious PHP execution inside public uploads location ~ ^/uploads/.*\.php$ { deny all; }}Verify your configuration integrity using nginx -t and restart the service via systemctl restart nginx. Afterwards, simply load the installation wizard install.php in your browser.