# Help with apache rewrite rule to nginx

**URL:** <https://www.ruby-forum.com/t/help-with-apache-rewrite-rule-to-nginx/225034>\
**Category:** NGINX\
**Created:** [December 7, 2012, 8:19pm UTC](https://www.ruby-forum.com/t/help-with-apache-rewrite-rule-to-nginx/225034 "2012-12-07T20:19:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![aris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/258eb7/32.png) [@aris](https://www.ruby-forum.com/u/aris)\
**Post date:** [December 7, 2012, 8:19pm UTC](https://www.ruby-forum.com/t/help-with-apache-rewrite-rule-to-nginx/225034/1 "2012-12-07T20:19:07Z")

</div>

Hello, would like to convert the below rule from Apache to nginx, but to  
be honest I have no clue how.

RewriteCond %{REQUEST\_FILENAME} -f [OR]  
RewriteCond %{REQUEST\_FILENAME} -d [OR]  
RewriteCond %{REQUEST\_FILENAME} gallery\_remote2.php  
RewriteCond %{REQUEST\_URI} !/main.php$  
RewriteRule . - [L]

Please if someone knows, please let me know, thank you!
