Lever-age / leverage

Empower citizens of Philadelphia to use campaign finance data when making informed decisions about who they donate to, who they support, and who they vote for.
http://leveragecampaignfinance.org/
20 stars 10 forks source link

Switch from Apache to nginx #18

Closed ghost closed 7 years ago

ghost commented 8 years ago

Since we run our own webserver, it could be worthwhile to use a modern, high-performance server.

lottspot commented 8 years ago

The nginx config has been placed in /usr/local/etc (in order to store it in a directory we can keep under version control) and has been configured to serve the static resources under /var/www/leverage.com/static/ from the /static/ URI.

AFAIK, no WSGI backend has been decided on or configured, so we'll obviously have to hold that discussion before I can configure nginx to serve requests to the application stack.

lottspot commented 8 years ago

After discusing with @BayoAdejare, sounds like Gunicorn was initially chosen in order to satisfy a rapid deployment, but with more time on our hands it should be feasible to configure uWSGI for a more powerful backend instead.

lottspot commented 8 years ago

Just noticed that nginx is running 4 worker processes... since we only have 1 CPU on the server, I dropped that down to 1.

lottspot commented 8 years ago

Uploaded the configs to a new repository; uwsgi has been configured as of 273a60 and enabled via nginx config in f686a7.

You can now view the running application on the server by pointing your local hosts file to the server's IP address.

lottspot commented 8 years ago

This item is ready for review

lottspot commented 8 years ago

Final note-- uWSGI is currently configured to run 5 workers.. I configured that number as a "for now" value, which I presume we'll want to tune further before turning this app loose for the public.

lottspot commented 7 years ago

This is long done