Nginx vs Apache or using Apache with nginx [closed]
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this questionI have been running a website which servers javascript widgets for about 2 years. Now my question is whether I should use nginx purely or I should continue using apache with nginx.
I have about 200 sign ups a day and that means that sometimes the request rate for widget goes up by 2000 a day. So, now the problem is switching to nginx means that i would not be able to use the rewrite rules that i am using in apache.
Now that is one problem I know of, but are there any other issues that I can expect to see in an nginx environment that I dont in Apache?
Would you suggest me to switch purely to nginx or stay with apache and nginx as reverse proxy?
You could still use the rewrite rules from Apache, with slight modifications (I took this from Nginx Primer):
Apache:
RewriteCond %{HTTP_HOST} ^example.org$ [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
Nginx:
if ($host != 'example.org' ) {
rewrite ^/(.*)$ http://www.example.org/$1 permanent;
}
Another issue is .htaccess files, but this would only be an issue if your sharing the server with others.
I would also research any Apache modules that your relying on and ensure that the Nginx equivalents include the same functionality. Definitely test your webapp with Nginx in a test environment first to identify any issues.
In the end, if your goal is better performance then the migration from Apache to Nginx should be worth it.
精彩评论