Table of Contents
How to have InDefero running on Nginx HTTP Server
Directory structure example
/home/myuser/public_html/mydomain.com/indefero/...
/home/myuser/public_html/mydomain.com/pluf/...
/home/myuser/public_html/mydomain.com/public/...
In the public folder, you may use symlink to indefero public folder :
index.php -> ../indefero/www/index.php
media -> ../indefero/www/media/
VHost example with PHP fast-cgi
server {
listen 80;
server_name www.mydomain.com;
client_max_body_size 2m;
access_log /home/myuser/public_html/mydomain.com/log/access.log;
error_log /home/myuser/public_html/mydomain.com/log/error.log;
root /home/myuser/public_html/mydomain.com/public/;
location / {
index index.php;
try_files $uri $uri/ /index.php?_pluf_action=/$uri&$args;
}
location = /index.php {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include /etc/nginx/fastcgi_params;
#expires max
}
}
Tips
expires max should be commented as Indefero handle the cache itself
This configuration works without rewrite rule (which requires an expensive If clause). For beautiful URLs you still have to set
$cfg['idf_base'] = '';
$cfg['url_base'] = 'http://www.mydomain.com';
in your src/IDF/conf/idf.php file.
- The location statement is "unusual" in that it hardcodes the single php entry file we provide. This avoids issues for paths like http://example.net/p/chf/source/tree/HEAD/index.php (which would match the .php$ clauses typical for nginx configs), and prevents any security issue due to user uploads (eg. to attachments/