How to make nginx to redirect multiple subdomains?

Want to make Ligthing Flash Magento store with Nginx + caching on AWS Elastic Beanstalk with Minimum Resource Utilization?

  • I'm going to install Magento on AWS Elastic Beanstalk t1.micro (free tier), on Windows or Linux + Nginx + Php-fpm  + eAccelerator, CDN (cloudfront), MemcacheD. I will ask my developer to make my website as fast as it can be with as much as possible, minimum AWS utilization. My webstore will have <1000 SKUs and I'm not expecting the traffic without going into thorough SEO/PPC. Now I have three questions: Do I really need Nginx microcaching along with eaccelerator? Do I need AWS Elastic Load Balancer with t1.micro tier for the sake of scalability (as I have heard that magento is resource hungry application, may fully utilize t1.micro AMI) or can I replace AWS ELB with Nginx load balancer? In AWS Elastic Beanstalk?

  • Answer:

    Hi there, One of my coworkers and I developed and managed over 200 Magento stores in 2011, for well known artists and companies including Kenny Cheney, zac brown band, Margaritaville and many more. Let me preface my answer with this: consider the possibility that AWS is not for you. Specifically, the economy of scale is where AWS shines. If you are keenly worried about cost, you can get a much cheaper deal with more power elsewhere. Let me start with a few troubling ideas you've conveyed. Magento on a t1.micro. This is a bad idea because Magento will need a fair amount of power to run at reasonable speed. No amount of caching will get you away from this (unless magento has changed wildly since the last time I worked closely with it, about a year ago). I recommend something with good disk performance and CPU, like a c1.medium. Since I saw no mention of it, I'm assuming you're going to try putting MySQL on the same t1.micro. If that's the case, let me save you a lot of headache: don't do it. Magento and MySQL on the same box will bring your instance to its knees with almost no traffic. You seem to be a big believer in nginx. I love nginx, but I caution making decisions without empirical data. Apache, while not as efficient with connections for many use cases, will probably provide the same performance as nginx or any other web server. What's important for Magento is http 1.1 and keep-alive. I can tell you right now, you will be optimizing magento, not your web server. If you do stick with nginx, which is totally fine, be cautious about security. Not to discredit nginx, but I say this because it's easier to configure nginx improperly. Now that's out of the way, some recommendations. Use Linux. eAccelerator is good. From my testing a couple years ago, I got better results with APC. Memcached will make an incredible difference. Definitely use it. Amazon provides a service called "ElastiCache," which is an elastic cluster of memcached servers. And to answer your specific questions: Do I really need Nginx microcaching along with eaccelerator? Not sure what you mean by micro caching. This answer can only be definitely answered by benchmarking the two options. It may be an improvement to have nginx do some caching; on the other hand, it may be worse if the cache doesn't get used or gets rewritten, causing an increase in memory and CPU utilization without any benefit. Do I need AWS Elastic Load Balancer with t1.micro tier for the sake of scalability (as I have heard that magento is resource hungry application, may fully utilize t1.micro AMI) If you only want one ec2 instance, the only thing you are afforded is the availability of having a well known DNS name for your server, even if you replace it with another one. Ask yourself if that's worth the cost. If you plan to scale, then an ELB is absolutely your best option. or can I replace AWS ELB with Nginx load balancer? In AWS Elastic Beanstalk? You could do either, but the ELB is going to be ten thousand times easier to implement and maintain. It will also be more stable. Elastic beanstalk will support either of these approaches, but the ELB will be far easier.

Jonathan Fenocchi at Quora Visit the source

Was this solution helpful to you?

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.