Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Okay I'm not like an expert on the subject or anything, but the way I think I understand it, nginx is a proxy that runs in front of the webserver that serves your django app, right?</p> <p>You could build a simple node.js server that does the same - listen on port 80, wait until the request is completely sent to the server, and then forward it to the webserver that serves the Django app. If your problem is that the webservers threads are being used up by long running uploads, then I think this would solve that problem.</p> <p>Here's some code - just off the top of my head</p> <pre><code>var http = require('http'); var server = http.createServer(function (req, res) { var headers = req.headers; var url = req.url; var method = req.method; var body = ''; req.addListener('data', function(chunk) { body += chunk; }); req.addListener('end', function() { // at this point the request is completely uploaded (including files) // so it can be forwarded to the django webserver var dj_client = http.createClient(8000, 'localhost'); var dj_req = dj_client.request(method, url, headers); dj_req.addListener('response', function (dj_res) { // here the response have been received from the django server // so we can return that to the waiting client res.writeHead(dj_res.status, dj_res.headers); dj_res.addListener('data', res.write); dj_res.addListener('end', res.close); }); // send the request to the django webserver dj_req.write(body); dj_req.close(); }); }); server.listen(80); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload