Comments (3)
Thank you!
I'm not so experienced with nginx. I just tried with my setup and it worked for me downloading a 2.2G file (tried with Chromium 80.0.3987.163 and wget 1.20 on nginx 1.16.1). My config is this
location / {
proxy_pass http://sharry-intern:9090;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
client_max_body_size 105M;
proxy_send_timeout 300s;
proxy_read_timeout 300s;
send_timeout 300s;
}
Do you have any idea why this can work here?
The doc says "The zero value disables buffering of responses to temporary files." Do you know if this means that the response must fit in memory (if buffering is enabled)?
Maybe it's even better to disable buffering responses from the body, wdyt?
from sharry.
here its Chromium 80.0.3987.163, nginx 1.14.2 for sharry and an other instance for https-offloading (on an other virtual machine) of same version.
Do you have any idea why this can work here?
maybe you set proxy_buffering off
somewhere globally? thats what I've done on my https-offloading nginx. check with nginx -T
and search for this parameter.
they are describing here https://trac.nginx.org/nginx/ticket/1472 kind of timeout by backend: "if the limit is reached, nginx will stop reading from the backend till all disk-buffered data are sent to the client. This in turn can result in a send timeout on the backend side."
my nginx error log reports such a backend timeout.
2020/04/11 16:31:59 [error] 791#791: *176597 readv() failed (104: Connection reset by peer) while reading upstream, client: 10.21.11.66, server: sharry.rekmp.net, request: "GET /api/v2/sec/share/CeR3a5qjEBd-v3pJ7hnEW14-1inSKT76Nqp-8S7nsVQxbzX/file/HHyNz1JLBjx-9SDGQmirhze-VXSRWKw8ufZ-SLBN6xK7Sa7 HTTP/1.0", upstream: "http://127.0.0.1:9090/api/v2/sec/share/CeR3a5qjEBd-v3pJ7hnEW14-1inSKT76Nqp-8S7nsVQxbzX/file/HHyNz1JLBjx-9SDGQmirhze-VXSRWKw8ufZ-SLBN6xK7Sa7", host: "sharry.rekmp.net"
maybe your downlink is just that fast that you will not experience that backend timeout.
Do you know if this means that the response must fit in memory (if buffering is enabled)?
if I do not misunderstand http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_buffering and https://www.scalescale.com/tips/nginx/optimizing-nginx-for-serving-files-bigger-than-1gb/ I would clearly say: no, need not fit into memory.
Maybe it's even better to disable buffering responses from the body, wdyt?
I would propose disabling buffering in any case. buffering means loosing bandwith you later do not have.
this is my config
location / {
proxy_pass http://localhost:9090;
include /etc/nginx/proxy_params;
# https://eikek.github.io/sharry/doc/reverseproxy#nginx
proxy_http_version 1.1;
#proxy_set_header Upgrade $http_upgrade;
#proxy_set_header Connection $connection_upgrade;
client_max_body_size 105M;
proxy_max_temp_file_size 0;
proxy_send_timeout 300s;
proxy_read_timeout 300s;
send_timeout 300s;
location = / {
return 302 /app;
}
}
from sharry.
I see, thank you for all the details. Yes, I then also think it is better to disable buffering in nginx. This only introduces backpressure problems.
And yes, I usually test with a too good connection. I haven't tested with slow connections yet, which I should do more seriously. It also means to provide more options to configure the sharry http server, for example to set custom timeouts. Currently for slow connections, one can only use a lower chunk size (not 100M). I will invest into these things for the next release.
from sharry.
Related Issues (20)
- Azure AD scope is duplicated. HOT 13
- Software version disclose in links HOT 2
- Document sending metadata via the REST API HOT 9
- [Feature Request] Support deployment behind a path
- Configuration of file upload limits HOT 3
- [Feature Request] Allow anonymous uploads to shares. HOT 1
- [FR] Allow expiration and deletion of unpublished shares HOT 4
- Responses contain `Content-Length` header and `Transfer-Encoding:chunked` headers HOT 21
- Allow to change schema when using postgresql
- s3 auth does not seem to support node / service account roles - access key and secret required HOT 3
- Problems with using Keycloak as OAuth provider HOT 6
- Azure AD Authentication doesn't work with java.net.ConnectException: Connection timed out HOT 6
- CORS blocked when uploading a file using Caddy reverse proxy. HOT 5
- nix: build sharry from source
- Error message : 106% percent over 100 HOT 6
- mp4 files are not playing in browser HOT 10
- Add ability to create admin accounts with all auth modules HOT 2
- Broken Nix installation guide HOT 1
- Sign-in with oauth (via Google) creates accounts even if signup is set to "invite" or "closed" HOT 4
- Site breaks in Chrome/Edge when `require-trusted-types-for` is enabled in CSP header HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sharry.