Forum: NGINX rewrite rules

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
52ec6f2d0206837902876df1c72e906d?d=identicon&s=25 Tomasz Pajor (Guest)
on 2009-06-01 07:38
(Received via mailing list)
Hello,

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!
2e321cc0efe9422d37165e922298494e?d=identicon&s=25 Cliff Wells (Guest)
on 2009-06-01 09:39
(Received via mailing list)
On Mon, 2009-06-01 at 07:30 +0200, Tomasz Pajor 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
}

Regards,
Cliff
This topic is locked and can not be replied to.