I've been having trouble with serving a Flask app via uWSGI and nginx, so I thought I'd put together some of the basics to help out others.
- Flask is managed by
uWSGI
. uWSGI
talks tonginx
.
# The blog post that started it all: https://neocities.org/blog/the-fcc-is-now-rate-limited | |
# | |
# Current known FCC address ranges: | |
# https://news.ycombinator.com/item?id=7716915 | |
# | |
# Confirm/locate FCC IP ranges with this: http://whois.arin.net/rest/net/NET-165-135-0-0-1/pft | |
# | |
# In your nginx.conf: | |
location / { |
/** | |
Automatically saves a policy every REFRESH milliseconds through AJAX, | |
but only when the .autosave form has changed. To use, add the class autosave | |
to your form. | |
Note: REFRESH must always be bigger than SAVE_TIMEOUT, otherwise a broken | |
save will cause deadlock for pending. | |
**/ | |
function processJson(data) { |