cluster

Infrastructure files for Nordgedanken and Midnightthoughts.
git clone git://archive.git.mtrnord.blog/MTRNord/cluster.git
Log | Files | Refs | README

locations (1333B)


      1 
      2 
      3 # tell the web container the address of the outside client
      4 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      5 # We tell that client should be behind https regardless if nginx is in reverse-proxy mode or https
      6 # mode
      7 proxy_set_header X-Forwarded-Proto https;
      8 proxy_set_header Host $host;
      9 proxy_redirect off;
     10 
     11 location ~ ^/(login[^-/]|password-reset|resend-link|2fa-check) {
     12     limit_req zone=loginlimit;
     13     proxy_pass http://web;
     14 }
     15 
     16 # do not log periodic polling requests from logged in users
     17 location /api/updates/ {
     18     access_log off;
     19     proxy_pass http://web;
     20 }
     21 
     22 location / {
     23     proxy_pass http://web;
     24 }
     25 
     26 # directly serve static files from the
     27 # bookwyrm filesystem using sendfile.
     28 # make the logs quieter by not reporting these requests
     29 location /static/ {
     30     root /app;
     31     try_files $uri =404;
     32     add_header X-Cache-Status STATIC;
     33     access_log off;
     34 }
     35 
     36 # same with image files not in static folder
     37 location /images/ {
     38     location ~ \.(bmp|ico|jpg|jpeg|png|svg|tif|tiff|webp)$ {
     39         root /app;
     40         try_files $uri =404;
     41         add_header X-Cache-Status STATIC;
     42         access_log off;
     43     }
     44     # block access to any non-image files from images
     45     return 403;
     46 }
     47 
     48 # monitor the celery queues with flower, no caching enabled
     49 location /flower/ {
     50    proxy_pass http://flower;
     51    proxy_cache_bypass 1;
     52 }