|

Nginx and osTicket 1.8 configuration

Recently when switching from Apache to Nginx for osTicket 1.8, I found that some functionality does not work properly. For example, when replying to customer’s via SCP, line break character does not display properly. In addition, some ajax-based features are not worked any more. After digging a little bit, I can solve the problem with nginx configuration. So in this quick note, I will mention on how to configure nginx and osTicket 1.8 so that they can live together 😛

First, assume that we have a website athttps://www.domain.com and the osTicket 1.8 is located at https://www.domain.com/support . We also configure to run the osTicket on Nginx, PHP-FPM and MariaDB stack.

In Nginx configuration, we will need to add the following configuration for osTicket to work properly:

[bash]
#– Quick fix will go with $path_info parameter
set $path_info "";
# Requests to /api/* need their PATH_INFO set, this does that
if ($request_uri ~ "^/support/api(/[^\?]+)") {
set $path_info $1;
}

# /api/*.* should be handled by /api/http.php if the requested file does not exist
location ~ ^/support/api/(tickets|tasks)(.*)$ {
try_files $uri $uri/ /support/api/http.php;
}

# /scp/ajax.php needs PATH_INFO too, possibly more files need it hence the .*\.php
if ($request_uri ~ "^/support/scp/.*\.php(/[^\?]+)") {
set $path_info $1;
}

# Make sure requests to /scp/ajax.php/some/path get handled by ajax.php
location ~ ^/support/scp/ajax.php/(.*)$ {
try_files $uri $uri/ /support/scp/ajax.php;
}

# Add trailing slash to */support requests.
rewrite /support$ $scheme://$host$uri/ permanent;

#To access without index.php in the link
location /support/ {
try_files \$uri \$uri/ /support/index.php?$query_string;
}

# Process PHP files
location ~ \.php {
try_files $uri = 404;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include /etc/nginx/fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $path_info;
}
[/bash]

Similar Posts

  • Install Apache Solr on CentOS 6

    Solr is the popular, blazing fast open source enterprise search platform from the Apache LuceneTM project. Its major features include powerful full-text search, hit highlighting, faceted search, near real-time indexing, dynamic clustering, database integration, rich document (e.g., Word, PDF) handling, and geospatial search. Solr is highly reliable, scalable and fault tolerant, providing distributed indexing, replication…

  • OwnCloud with NginX and PostgreSQL

    This quick tutorial will help you run the OwnCloud with NginX and PostgreSQL on Ubuntu 14.04. Add the necessary repo to /etc/apt/sources.list: [bash]# nginx stable deb http://nginx.org/packages/ubuntu/ trusty nginx deb-src http://nginx.org/packages/ubuntu/ trusty nginx # nginx mainline deb http://nginx.org/packages/mainline/ubuntu/ trusty nginx deb-src http://nginx.org/packages/mainline/ubuntu/ trusty nginx[/bash] Update system: [bash]apt-get update apt-get dist-upgrade[/bash] Install nginx: [bash]apt-get install nginx[/bash] Install dependencies for…

  • Install Chef server Lets Encrypt

    Do not want to mention what Chef is, or what Let’s Encrypt is. This is just a short step-by-step tutorial to guide you how to install Chef server Lets Encrypt for the server SSL. Setup Let’s Encrypt First, install let’s encrypt to generate a standalone certificate before installing chef server: [bash]git clone https://github.com/letsencrypt/letsencrypt cd letsencrypt…

  • Install StartSSL certificate to Webmin

    This guide provide step-by-step on how to install StartSSL certificate to Webmin so that we can access to the Wemin Control Panel with a signed https address. First, if the private key is created by StartSSL and password-protected, we should decrypt it:[bash]openssl rsa -in server.name-ssl.key -out server.name-ssl.key[/bash] Combined private keys and certificates to have webmin-compatible…

Leave a Reply

Your email address will not be published. Required fields are marked *