We have an ec2 instance in AWS cloud running on amazon AMI and plan to deploy a web application (medium scale app).



Server configurations

1.Nginx as reverse proxy server with Apache.

2.Pure nginx with php-fpm without Apache.

Which one is better for a scalable application? in terms of both security and performance?

Suppose if we choose the first method do we need a separate server? One for nginx(proxy server) and one for apache (Application server).

  • 1
    Start simple, grow more complex. In a reverse-proxy design, usually scalability is achieved by spreading the hard work over multiple application server backends; a tuning process that requires application-specific analysis. – Andrew Domaszek Mar 8 '17 at 11:56
  • so start with ngnix+php-fpm ? – Jabaa Mar 8 '17 at 12:05
  • At this point in your development cycle, it sounds like it won't make that much difference either way. You can always empirically test your configuration with artificial test programs to see how you need to optimize; these results will change as you implement your application. – Andrew Domaszek Mar 8 '17 at 12:16

Nginx with PHP-FPM is the simpler, more scalable solution, and security is much the same between the two. Both options work fine on a single server.

Apache is not an application server, it's a web server, I guess in the context of option 1 you could think of Nginx as the web server and Apache as the application server.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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