Welcome! Log In Create A New Profile

Advanced

Nginx + Fastcgi + SocialEngine

Posted by Footman 
This forum is currently read only. You can not log in or make any changes. This is a temporary situation.
Nginx + Fastcgi + SocialEngine
March 17, 2011 01:41PM
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

Online Users

Guests: 311
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready