Nginx conf to proxy downloads from /dashboard/ URLs
@@ -19,4 +19,17 @@ server {
proxy_pass http://web:8000/;
}
+ # Sendfile support to serve non-html files under "/dashboard/<project_slug>/downloads/<type>/<version_slug>"
+ location /proxito/ {
+ internal;
+ # Nginx will strip the `/proxito/` and pass just the `<type>/$proj/$ver/$filename`
+ # So we need to make sure we pass it to `media/` for the proper URL
+ proxy_pass http://storage:10000/;
+ proxy_set_header Host storage:10000;
+ proxy_set_header X-Real-IP $remote_addr;
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+ proxy_set_header X-Forwarded-Host $host;
+
+ add_header X-Served Nginx-Proxito-Sendfile always;
+ }
}
