I would like to deploy lithium framework on nginx (with php-fpm), however I'm stuck transforming .htaccess rules to nginx.
Framework has following structure:
/
|-.htaccess (#1)
|-index.php (requires next index.php)
|-app/
| |-.htacces (#2)
| |-index.php (just requires next index.php)
| |-webroot/
| | |-.htaccess (#3)
| | |-index.php (the one that finally handles requests)
.htaccess #1
RewriteRule ^$ app/webroot/ [L]
RewriteRule (.*) app/webroot/$1 [L]
.htaccess #2
RewriteRule ^$ webroot/ [L]
RewriteRule (.*) webroot/$1 [L]
.htaccess #3
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !favicon.ico$
RewriteRule ^ index.php [QSA,L]
Thus far I've created following rules:
location / {
rewrite ^$ /app/webroot/;
rewrite (.*) /app/webroot/$1;
}
location /app/ {
rewrite ^$ webroot/;
rewrite (.*) webroot/$1;
}
location /app/webroot/ {
index index.php;
try_files $uri $uri/ /index.php;
### OR ###
rewrite ^ index.php last;
}
But those are (completely?) wrong. Either application cannot access static files, all links become http://index.php/something or links get appended to current URL.
What am I doing wrong?
Please, can someone help me get on the right track.
import antigravity
Edited 1 time(s). Last edit at 05/25/2012 08:46AM by liepumartins.