~funderscoreblog cgit wikiget in touch

« Homepage

This page is incomplete and a work-in-progress

Information contained here may be inaccurate or incomplete. You have been warned.

Run app.py:

$ cd /path/to/laboratory/source/code
$ gunicorn -B <ip>:<port> app:app

And configure nginx like so:

   1 # /etc/nginx/conf.d/laboratory
   2 # Adapt as necessary
   3 server {
   4         server_name lab.example.com;
   5         try_files $uri @laboratory;
   6         location @laboratory {
   7                 limit_req zone=one burst=5;
   8                 proxy_pass http://127.0.0.1:8080; # replace with the address `gunicorn` is listening to
   9                 proxy_redirect off;
  10                 proxy_set_header Host $host;
  11                 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  12                 proxy_set_header X-Forwarded-Proto $scheme;
  13         }
  14 }