djangosnippets.org: Latest snippets tagged with 'nginx'https://djangosnippets.org/tags/nginx/2019-04-17T06:53:36.356646-05:00Django nginx sendfile example
2019-04-17T06:53:36.356646-05:00sim1234https://djangosnippets.org/snippets/10664/<p>Use nginx sendfile (X-Accel-Redirect) function to serve files but pass traffic through django. Can be used to serve media files only to logged-in users.</p>
Freely redistributableEffective content caching for mass-load site using redirect feature
2011-07-07T04:34:14.065420-05:00nnsevahttps://djangosnippets.org/snippets/2480/<p>Hi All,</p>
<p>I would like to share my idea and experience in using http redirect feature to organize effective content caching and avoid site blocking on mass requests to not yet cached content.</p>
<p>First of all, I should explain that I don't mean usual template-based pages, whose caching in django …</p>
Freely redistributabledjango on tornado
2009-09-29T20:40:00.851163-05:00lawgonhttps://djangosnippets.org/snippets/1748/<p>there have been many posts on running django on tornado with static media served by nginx. But for dumb people like me, the whole thing needs to be spelt out. So here is how I succeeded in serving django from a virtual host using nginx and tornado. The key thing …</p>
Freely redistributableminimal nginx conf to split get/post requests
2008-10-14T07:33:17.843728-05:00amituhttps://djangosnippets.org/snippets/1141/<p>After a point the sql server becomes the bottleneck in lots of web application, and to scale, master-slave replication with single master, multiple slave is recommended. This setup with nginx can be used to accomplish traffic distribution between master and slave based on request method. </p>
Freely redistributablenginx x-accel-redirect protection of static files
2007-11-29T05:17:06.901937-06:00seanhttps://djangosnippets.org/snippets/491/<p>This snippet requires nginx as your front end server (for serving static files) and any django enabled server as a backend that only gets the dynamic requests (I use apache with mod_python). If you have no idea what I'm talking about, you probably won't need this snippet.
I previously tried …</p>
Freely redistributable