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 – root versus alias, for serving single files?

Well, these two directives are slightly functional different because you do not use exact match in the latter case. So, /robots.txt1111 will match your second location too. location =/robots.txt { root /home/www/static/; } is an exact functional equivalent of your first directive.

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

How to make a modification take affect without restarting nginx?

nginx supports the following signals : TERM, INT – Quick shutdown QUIT – Graceful shutdown HUP – Configuration reload: Start the new worker processes with a new configuration, Gracefully shutdown the old worker processes USR1 – Reopen the log files USR2 – Upgrade Executable on the fly WINCH – Gracefully shutdown the worker processes HUP … 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

an upstream response is buffered to a temporary file

How can I remove the [warn] and avoid buffering responses? Is it better to turn off proxy_buffering or set proxy_max_temp_file_size to 0? Why? You should set proxy_max_temp_file_size to 0 in order to remove it. The proxy_buffering directive isn’t directly related to the warning. You can switch it off to stop any buffering at all but … Read more

tech