Elgg on nginx webserver
Officially, elgg supports only apache webserver, but that only mean elgg is distributed with apache htaccess file, and if you want to run elgg on a different server you have to come up with settings. Nginx is one of the other servers, good alternative for apache. Nginx is fames for low memory consumption, ideally for low-cost vps or dedicated servers. Where nginx relay stands out, is serving static content.
Revrite roules for elgg on nginx:
rewrite ^/action\/([A-Za-z0-9\_\-\/]+)$ /engine/handlers/action_handler.php?action=$1&$args; rewrite ^/cache\/(.*)$ /engine/handlers/cache_handler.php?request=$1&$args;
rewrite ^/services\/api\/([A-Za-z0-9\_\-]+)\/(.*)$ /engine/handlers/service_handler.php?handler=$1&request=$2&$args;
rewrite ^/export\/([A-Za-z]+)\/([0-9]+)\/?$ /engine/handlers/export_handler.php?view=$1&guid=$2;
rewrite ^/export\/([A-Za-z]+)\/([0-9]+)\/([A-Za-z]+)\/([A-Za-z0-9\_]+)\/$ /engine/handlers/export_handler.php?view=$1&guid=$2&type=$3&idname=$4;
rewrite /xml-rpc.php /engine/handlers/xml-rpc_handler.php;
rewrite /mt/mt-xmlrpc.cgi /engine/handlers/xml-rpc_handler.php;
rewrite ^/rewrite.php$ /install.php;
if (!-d $request_filename){
set $rule_11 1$rule_11;
}
if (!-f $request_filename){
set $rule_11 2$rule_11;
}
if ($rule_11 = "21"){
rewrite ^/([A-Za-z0-9\_\-]+)$ /engine/handlers/page_handler.php?handler=$1;
}
if (!-d $request_filename){
set $rule_12 1$rule_12;
}
if (!-f $request_filename){
set $rule_12 2$rule_12;
}
if ($rule_12 = "21"){
rewrite ^/([A-Za-z0-9\_\-]+)\/(.*)$ /engine/handlers/page_handler.php?handler=$1&page=$2;
}