Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nginx Osticket config Error #894

Open
martinreynolds opened this issue Oct 17, 2014 · 0 comments
Open

Nginx Osticket config Error #894

martinreynolds opened this issue Oct 17, 2014 · 0 comments

Comments

@martinreynolds
Copy link

this is my nginx config:

server {
listen 80 ;
server_name xxxx;

charset UTF-8;

charset koi8-r;

access_log /var/log/nginx/log/osticket.access.log main;
error_log /var/log/nginx/log/osticket.error.log;
root /var/www/osticket/;

set $path_info "";

Deny access to all files in the include directory

location ~ ^/include {
deny all;
return 403;
}

Deny access to apache .ht* files (nginx doesn't use these)

location ~ /.ht {
deny all;
}

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?$query_string;
}

/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?$query_string;
}
location / {
try_files $uri $uri/ index.php;
}

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;
}
It still not to work, and reply scp/ajax.php/config/scp 404 Not Found

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant