-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNotes.txt
24 lines (18 loc) · 1.1 KB
/
Notes.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
To set up a production WSGI server: https://towardsdatascience.com/deploying-flask-with-gunicorn-3-9eaacd0f6eea
Application Server vs. Web Server
Seems that an application server processes dynamic content, and a web server serves up static content. This can be done very quickly since the web server is a worker model.
If you want authentication on the static files -> https://docs.nginx.com/nginx/admin-guide/security-controls/configuring-subrequest-authentication/
Great Read on setting up flask/nginx on EC2 -> https://medium.com/@varunchitale/a-simple-python-api-using-flask-with-nginx-setup-on-aws-ec2-4a380ceaf006
gunicorn --workers 3 --bind 0.0.0.0:5000 wsgi:app
Or, for nginx
gunicorn --workers 2 --bind unix:flask-api.sock wsgi:app
Nginx server config /etc/nginx/sites-available/flask-api
server {
listen 80;
server_name philliprstephens.com www.philliprstephens.com;
location / {
include proxy_params;
proxy_pass http://unix:~/secure-python-flask-api/flask-api.sock;
}
}
sudo ln -s /etc/nginx/sites-available/flask-api /etc/nginx/sites-enabled