0

I'm so confused as to what benefits I will be getting from using Apache to serve my Flask App in my EC2 instance if it's already out there to the public, & whether I have to think about using something like Apache or Nginx from the first place?

Why not just configure a production server like gunicorn (as I heard it's better to be used for security purposes even though this answer kinda made me doubt this a bit) and get a private domain and that's it for my flask app?

ShifraSec
  • 106
  • 2
  • 9
  • you should focus more your question, are you asking is if possible to run a Flask App in AWS EC2 using `gunicorn` **and avoid** using Apache? – Federico Baù Jan 04 '21 at 12:38
  • 1
    something along these lines as is it recommended ? or what benefits do I get from that? @Oleksii Donoha answer is great – ShifraSec Jan 05 '21 at 17:16
  • 1
    I don't know why you got all those dislikes but that's indeed a helpful Question. at least for us beginners – MR.X_XD Jan 20 '21 at 22:43

1 Answers1

1

This question boils down to "application server vs web server". In your case gunicorn is an app server, and nginx/apache is a web server.

What is the difference between application server and web server?

To give some brief advice, you need to consider the scale and actual functionality of your app. If you expect to serve any consistent number of users, use web server, they are better optimized to serve concurrent requests. If your app serves some static files - also use web server, they do it more efficiently. If it's an internal app which only you and couple of guys use occasionally, you can get by only running a gunicorn.

Oleksii Donoha
  • 2,911
  • 10
  • 22