M
M
Maxim2010-11-01 08:34:31
Nginx
Maxim, 2010-11-01 08:34:31

RewriteRule adaptation for nginx for SocialEngine

Friends, help. I'm trying to run SocialEngine directly under nginx/php-fpm, without Apache. It looks like three simple RewriteRule, but I've been sitting for the second hour without success.

Here's what's in the original: How will it be in the nginx config? The QSA flag, which was previously unknown to me, raises the most questions. I feel there is a trick somewhere in it.

RewriteCond %{REQUEST_URI} /index\.php
RewriteRule (.*) index.php?rewrite=2 [L,QSA]

RewriteCond %{REQUEST_URI} /$
RewriteRule (.*) index.php?rewrite=1 [L,QSA]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?rewrite=1 [L,QSA]


Answer the question

In order to leave comments, you need to log in

2 answer(s)
T
tzlom, 2010-11-01
@tzlom

location /index.php {
rewrite ^(.*)$ /index.php?rewrite=2 last;
}
location / {
index = index.php?rewrite=1
if (!-e $request_filename) {
rewrite ^(.+)$ /index.php?rewrite=1 last;
}
}

S
Sergey, 2010-11-01
@bondbig

I recommend contacting the off. nginx mailing list. There you will be professionally prompted (and even written) the best option. Sometimes Igor himself. Often, only a couple of simple locations remain from monster rewrites with regexps.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question