开发者

Nginx vs Apache or using Apache with nginx [closed]

开发者 https://www.devze.com 2023-03-28 07:17 出处:网络
Closed. This question is opinion-based. It is not currently accepting answers. 开发者_开发技巧 Want to improve this question? Update the question so it can be answered with facts and citation
Closed. This question is opinion-based. It is not currently accepting answers. 开发者_开发技巧

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 question

I 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号