Welcome! Log In Create A New Profile


Apache Rewrite rule convert to Nginx

Posted by mottoyin 
Apache Rewrite rule convert to Nginx
February 01, 2016 03:37AM
Hi all, I'm newer to start to deploy the Nginx service in our company test farm, currently the rewrite rules torched me for almost 1 week. Appreciated if any one of you could give me hint or answers on the issue as blow:

1. We have seperate the reqrite configuration from apache configuration file called "rewrite.conf" and with the records as below:

RewriteCond %{DOCUMENT_ROOT}/sitedown.txt -f
RewriteCond %{REQUEST_FILENAME} !.*downtime.*
RewriteRule $ http://nginxtest.cn.xxx.com/downtime/index.html [R=307,L]

The rewrite rule will detect if a file called "sitedown.txt" under document_root folder and if any one tried to visit the site will be redirected to the maintenance page, I have no idea on how to configure the same thing on Nginx because the Nginx doesn't support if (conditon1 .&& condition2){rewrite .......}
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 323
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready