# Translation from apache2 to nginx

**URL:** <https://www.ruby-forum.com/t/translation-from-apache2-to-nginx/217693>\
**Category:** NGINX\
**Created:** [March 8, 2012, 9:53pm UTC](https://www.ruby-forum.com/t/translation-from-apache2-to-nginx/217693 "2012-03-08T21:53:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![luislavena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/0ea827/32.png) [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Post date:** [March 8, 2012, 9:53pm UTC](https://www.ruby-forum.com/t/translation-from-apache2-to-nginx/217693/1 "2012-03-08T21:53:45Z")

</div>

Hi forumers,  
I don’t know how to translate the following .htaccess to nginx rules  
(from bluebox):

 # Turn on URL rewriting RewriteEngine On

```
# Installation directory
###RewriteBase /kohana/

# If the request is for a modules assets directory allow it
RewriteRule ^modules/.*/assets/.*$ - [L]

# Protect application and system files from being viewed
###RewriteRule ^(bluebox|modules|system|upload)/ - [F,L]

# Catch requests for XML or JSON and send them through an alternate

```

entry point  
RewriteRule ^(.+).json$ json.php/$1 [T=application/json,L]  
RewriteRule ^(.+).xml$ xml.php/$1 [T=text/xml,L]

```
# Allow any files or directories that exist to be displayed

```

directly  
RewriteCond %{REQUEST\_FILENAME} installer.html [OR]  
RewriteCond %{REQUEST\_FILENAME} !-f  
RewriteCond %{REQUEST\_FILENAME} !-d

```
# Rewrite all other URLs to index.php/URL
RewriteRule .* index.php/$0 [PT,L]

```

# Limits the file size that a user can upload

php\_value upload\_max\_filesize 25M

# Max execution time. Is here for the media module

# After X seconds, the file upload will stop

php\_value max\_execution\_time 300

Posted at Nginx Forum:

> **[Translation from apache2 to nginx](https://forum.nginx.org/read.php?2,223648,223648#msg-223648)**
>
> Hi forumers, I don't know how to translate the following .htaccess to nginx rules (from bluebox): \<IfModule mod\_rewrite.c\> # Turn on URL rewriting RewriteEngine On # Installation directory ###RewriteBase /kohana/
