Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Converting the rewrite rules from Apache to Nginx does not seem to be that difficult
However, I'd like to automate the job, as we are planning to migrate a number of sites.

  • Is there any existing script or tool to perform this operation?
  • If not, are there some specificities in the Apache / Nginx conventions that will make the regular expression conversions harder?
share|improve this question

1 Answer 1

up vote 1 down vote accepted

One exists, but it's really, really horrible. Your question also shows that you're probably not converting them properly. Where Apache uses rewrite conditions and rewrite rules primarily Nginx uses a combination of location blocks, try_files and rewrite. Many Nginx newbies will put all their rewrite directives into the server block or into a location / block. This means that you're not taking advantage of the hash tables Nginx generates and you will be evaluating all the rewrite rules on each requests - and that's just a waste of CPU cycles.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.