VirtualBox, Shared Folders and Cache

I have recently set up a virtual server environment using VirtualBox for quick web development. Using shared folders feature, I wanted to avoid file uploads between VM host and guest. However, when I make request to an updated a file, server responses with the old version.

First, I cleared and disabled my browser cache. The result was the same. Second, I checked the file both on host and guest machines. Both were up to date, so the issue was about the server. Then I have made some experiments with expires headers, again, no luck.

I continued searching on the internet and found this blog post. Sendfile option is disabled by default on Nginx (see documentation), but apparently Ubuntu had turned it on with the configuration file on the package. You can turn it off by setting the flag off or commenting the line:

# sendfile on;
# or
sendfile off;

Sendfile is enabled by default of Apache. In order to turn it off, you can refer to the official documentation here.

How to Run Flask Applications with Nginx Using Gunicorn

We have recently bought a VPS for İTÜ24, the online newsletter of Istanbul Technical University. The server is running on Ubuntu Server 12.04 operating system. Due to limited memory resources and performance concerns, we preferred to setup nginx as web server.

Our server will serve several web pages and applications developed in various programming languages, such as PHP, Python, Ruby (on Rails). Currently, we have one Python application, which is using Flask framework.

How we run Flask application with nginx, step by step…
Continue reading “How to Run Flask Applications with Nginx Using Gunicorn”