Forum: NGINX rewrite rules

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Tomasz P. (Guest)
on 2009-06-01 09:38
(Received via mailing list)

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]

Can anybody point me out how should this rules look like for nginx,
thanks in advance!
Cliff W. (Guest)
on 2009-06-01 11:39
(Received via mailing list)
On Mon, 2009-06-01 at 07:30 +0200, Tomasz P. wrote:
> thanks in advance!
I don't think you'll need any rewrites in Nginx.  It appears that the
above basically says, "if the file exists, serve it, otherwise hand the
request to PHP".  In Nginx that equates to:

location / {
    root /path/to/docroot;
    expires 30d;
    index index.php;
    error_page 404 = index.php;
    log_not_found off;

location \.php$ {
    # ... usual PHP FastCGI stuff

This topic is locked and can not be replied to.