Skip to content

Instantly share code, notes, and snippets.

@pix2D
Created April 29, 2012 20:04
Show Gist options
  • Save pix2D/2552976 to your computer and use it in GitHub Desktop.
Save pix2D/2552976 to your computer and use it in GitHub Desktop.
ActiveCollab 3 + NGINX + PHP-FPM + SSL + /public as document root
<?php
/**
* activeCollab configuration file
*/
define('ROOT', '/home/example/public_html/activecollab');
define('ROOT_URL', 'https://example.com');
define('URL_BASE', ROOT_URL . '/');
define('ASSETS_URL', ROOT_URL . '/assets');
define('PATH_INFO_THROUGH_QUERY_STRING', false);
// Other config stuff below (this will be different for each install so it's not included here
server {
listen [ip-address]:80;
server_name example.com;
root /home/example/public_html/public;
access_log /var/log/nginx/access.log;
location / {
try_files $uri $uri/ /index.php?path_info=$uri&$args;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
include fastcgi_params;
fastcgi_index index.php;
fastcgi_intercept_errors on;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_pass unix:/var/run/php-fpm-example.sock;
}
}
server {
listen [ip-address]:80;
server_name example.com;
rewrite ^(.*) https://$server_name$1 permanent;
}
server {
listen [ip-address]:443 ssl;
server_name example.com;
root /home/example/public_html/public;
ssl_certificate certificates/example.com.crt;
ssl_certificate_key certificates/example.com.key;
access_log /var/log/nginx/access.log;
location / {
try_files $uri $uri/ /index.php?path_info=$uri&$args;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
include fastcgi_params;
fastcgi_index index.php;
fastcgi_intercept_errors on;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param HTTPS on;
fastcgi_param HTTP_SCHEME https;
fastcgi_pass unix:/var/run/php-fpm-example.sock;
}
}
[example]
user = example
group = example
listen = /var/run/php-fpm-example.sock;
pm = ondemand
pm.max_children = 15
pm.process_idle_timeout = 300s
pm.max_requests = 500
request_terminate_timeout = 120s
chdir = /
php_admin_value[open_basedir] = /home/example/public_html:/tmp
php_admin_value[cgi.fix_pathinfo] = 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment