Hello, i am trying to convert socialengine apache rewrites to nginx. There is allready a topic but its old and didn't help me. Maybe you can help me?
Here is rewrite from apache:
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
# Get rid of index.php
RewriteCond %{REQUEST_URI} /index\.php
RewriteRule (.*) index.php?rewrite=2 [L,QSA]
# Rewrite all directory-looking urls
RewriteCond %{REQUEST_URI} /$
RewriteRule (.*) index.php?rewrite=1 [L,QSA]
# Try to route missing files
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} public\/ [OR]
RewriteCond %{REQUEST_FILENAME} \.(jpg|gif|png|ico|flv|htm|html|php|css|js)$
RewriteRule . - [L]
# If the file doesn't exist, rewrite to index
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?rewrite=1 [L,QSA]
</IfModule>
and this rewrite works only partly for me (also ajax doesn't work, adminpanel configuration does't work, status post doesn't work and it freezes often):
location / {
root /data/socialengine/htdocs/;
index index.php;
if (!-e $request_filename) { rewrite ^(.*)$
/index.php?rewrite=1; }
}
location ~ index\.php {
root /data/socialengine/htdocs/;
rewrite .* /index.php?rewrite=1 break;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME
/data/socialengine/htdocs$fastcgi_script_name;
include fastcgi_params;
fastcgi_param DOCUMENT_ROOT
/data/socialengine/htdocs/;
fastcgi_pass_request_body off;
client_body_in_file_only clean;
fastcgi_param REQUEST_BODY_FILE
$request_body_file;
}
location /install/ {
root /data/socialengine/htdocs/;
index index.php;
if (!-e $request_filename) { rewrite ^(.*)$
/install/index.php?rewrite=1; }
}
location ~* \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME
/data/socialengine/htdocs$fastcgi_script_name;
include fastcgi_params;
fastcgi_param DOCUMENT_ROOT
/data/socialengine/htdocs/;
fastcgi_pass_request_body off;
client_body_in_file_only clean;
fastcgi_param REQUEST_BODY_FILE
$request_body_file;
}
Please help me to work out a solution.
Thanks