Why do I need nginx when I have uWSGI

You don’t. That’s the simple answer, anyway — you don’t need it. uWSGI is itself a capable server. However, other servers like nginx have been around longer and are (probably, anyway) more secure, as well as having additional features not supported by uWSGI — for example, improved handling of static resources (via any combination of … Read more

Nginx Redirect via Proxy, Rewrite and Preserve URL

First, you shouldn’t use root directive inside the location block, it is a bad practice. In this case it doesn’t matter though. Try adding a second location block: location ~ /some/path/(?<section>.+)/index.html { proxy_pass http://192.168.1.24/$section/index.html; proxy_set_header Host $host; } This captures the part after /some/path/ and before index.html to a $section variable, which is then used … Read more

Disable caching when serving static files with Nginx (for development)

Since the answer is somehow hidden in the question – here is the solution for nginx in a VirtualBox environment as standalone answer. In your nginx config (usally /etc/nginx/nginx.conf) or vhost config file change the sendfile parameter to off: sendfile off; While sendfile is at the heart of Nginx’s fame (blazing-fast low-level static file serving … Read more

“413 Request Entity Too Large” in Nginx with “client_max_body_size” set

Modify NGINX Configuration File sudo nano /etc/nginx/nginx.conf Search for this variable: client_max_body_size. If you find it, just increase its size to 100M, for example. If it doesn’t exist, then you can add it inside and at the end of http client_max_body_size 100M; Test your nginx config changes. sudo service nginx configtest Restart nginx to apply … Read more