I have a working config, but for 1.9, so you'd need to add few missing rules. Have a look here: https://gist.github.com/Srokap/7dbfc423812f09a5ee43 and for thread with few other versions: https://github.com/Elgg/Elgg/issues/5929
Thanks @RvR & @Pawel Sroka, I´ve done a small progress, the rewriting seems to be working with this rule:
rewrite ^/action/([\/A-Za-z0-9_-]+)$ /engine/handlers/action_handler.php?action=$1 last;
This is the log:
2014/04/05 05:42:45 [notice] 27116#0: *27 rewritten data: "/engine/handlers/action_handler.php", args: "action=login", client: 212.170.174.236, server: ec2-54-72-103-90.eu-west-1.compute.amazonaws.com, request: "POST /action/login HTTP/1.1", host: "ec2-54-72-103-90.eu-west-1.compute.amazonaws.com", referrer: "http://ec2-54-72-103-90.eu-west-1.compute.amazonaws.com/login"
BUT
When I try to login, it dont works, the button Log in does nothing.
If anyone would test it, this is the url http://ec2-54-72-103-90.eu-west-1.compute.amazonaws.com/login
Any suggestion??, I´m obsessed with this!!!
I reply myself, there was an issue with igbynary PHP module, is not working with Elgg:
#
## Nginx configuration for Elgg 1.8
#
server {
listen 80;
server_name myurl.com;
charset utf8;
error_log /mydirectory/log/error.log debug;
root /mydirectory/public;
index index.php;
client_max_body_size 8M;
client_body_buffer_size 256K;
#rewrite_log on;
try_files /maintenance.html $uri @rewrite;
location @rewrite {
# # Legacy URL rewriting (for use with the legacy URL plugin)
# rewrite ^/pg/([A-Za-z0-9_-]+)$ /engine/handlers/page_handler.php?handler=$1 last;
# rewrite ^/pg/([A-Za-z0-9_-]+)/(.*)$ /engine/handlers/page_handler.php?handler=$1&page=$2 last;
# rewrite ^/tag/(.+)/?$ /engine/handlers/page_handler.php?handler=search&page=$1 last;
# Fallback to the new router
rewrite ^(.*)$ /index.php?__elgg_uri=$uri&$args last;
}
# rewrite ^/pg/([A-Za-z0-9_-]+)$ /engine/handlers/page_handler.php?handler=$1 last;
# rewrite ^/pg/([A-Za-z0-9_-]+)/(.*)$ /engine/handlers/page_handler.php?handler=$1&page=$2 last;
# rewrite ^/tag/(.+)/?$ /engine/handlers/page_handler.php?handler=search&page=$1 last;
# rule for rewrite module test during install - can be removed after installation
rewrite ^/rewrite.php$ /install.php last;
# Routes to specific handlers
rewrite ^/action/([\/A-Za-z0-9_-]+)$ /engine/handlers/action_handler.php?action=$1 last;
rewrite ^/cache(.*)$ /engine/handlers/cache_handler.php?request=$1 last;
rewrite ^/export/([A-Za-z]+)/([0-9]+)/?$ /engine/handlers/export_handlers.php?view=$1&guid=$2 last;
rewrite ^/services/api/([A-Z-a-z0-9_-]+)/(.*)$ /engine/handlers/service_handler.php?handler=$1&request=$2 last;
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;
}
include /usr/local/nginx/conf/staticfiles.conf;
include /usr/local/nginx/conf/php.conf;
include /usr/local/nginx/conf/drop.conf;
#include /usr/local/nginx/conf/errorpage.conf;
}
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by Raül Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.