server { listen 5986; server_name adminpanels.us.to; ssl on; ssl_certificate /etc/nginx/ssl/nginx.crt; ssl_certificate_key /etc/nginx/ssl/nginx.key; root /home/virtual/www/html/ticket/upload; index index.php; set $path_info ""; # Requests to /api/* need their PATH_INFO set, this does that if ($request_uri ~ "^/api(/[^\?]+)") { set $path_info $1; } # /api/*.* should be handled by /api/http.php if the requested file does not exist location ~ ^/api/(tickets|tasks)(.*)$ { try_files $uri $uri/ /api/http.php; } # /scp/ajax.php needs PATH_INFO too, possibly more files need it hence the .*\.php if ($request_uri ~ "^/scp/.*\.php(/[^\?]+)") { set $path_info $1; } # Make sure requests to /scp/ajax.php/some/path get handled by ajax.php location ~ ^/scp/ajax.php/(.*)$ { try_files $uri $uri/ /scp/ajax.php; } # Set index.php as our directoryindex location / { index index.php; } location ~ .*\.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $path_info; include fastcgi_params; fastcgi_intercept_errors on; } location ~ ^/include { deny all; return 403; } location ~ /(\.ht|\.git|\.svn) { deny all; } }