I want to convert some apache rules into nginx ones, and im new to nginx ...
So I searched and searched; but didn't find what I want to do. Here is the lines I want to convert in Nginx :
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule (.*) index.php?page=$1 [NC,L,QSA]
And here is what I tried:
location ~ ^/(?<page>[^\/]+)$ {
try_files $uri /index.php?page=$page;
}
location ~ ^/(?<page>[^\/]+)?(?<qsa>[.*]+)$ {
try_files $uri /index.php?page=$page&$qsa;
}
This isn't doing the job. What am i doing wrong?
EDIT
It was too long so i processed it with PHP, but i still wish an answer to this, i will be generous with anyone will answer nicely to this question !
apt-get nginx
;) ) – Bobot Aug 31 '14 at 21:39