mirror of
https://github.com/webrecorder/pywb.git
synced 2025-03-14 15:53:28 +01:00
I was playing back a YouTube video and noticed that the playback worked fine with using uwsgi/pywb directly but failed when using nginx. I think a very long HTTP Link header was causing nginx to hang up. I increased the uwsgi_buffer_size to 8k and the problem went away. Maybe this will save someone else some time if it is increased? https://nginx.org/en/docs/http/ngx_http_uwsgi_module.html#uwsgi_buffer_size
40 lines
808 B
Plaintext
40 lines
808 B
Plaintext
# nginx config for running under /wayback/ prefix
|
|
|
|
|
|
# set acl_user, defaulting to empty (any public user)
|
|
geo $acl_user {
|
|
# ensure user is set to empty by default
|
|
default "";
|
|
|
|
# optional: add IP ranges to allow privileged access
|
|
127.0.0.1 "staff";
|
|
192.168.0.0/24 "staff";
|
|
}
|
|
|
|
|
|
|
|
server {
|
|
listen 80;
|
|
|
|
# optinal: optimization to have nginx serve static assets
|
|
location /wayback/static {
|
|
alias /pywb/pywb/static;
|
|
}
|
|
|
|
# required: pywb with prefix
|
|
location /wayback/ {
|
|
resolver 127.0.0.1;
|
|
|
|
uwsgi_pass pywb:8081;
|
|
uwsgi_buffer_size 8k;
|
|
|
|
|
|
include uwsgi_params;
|
|
uwsgi_param UWSGI_SCHEME $scheme;
|
|
|
|
# pass acl_user (which should be empty by default)
|
|
uwsgi_param HTTP_X_PYWB_ACL_USER $acl_user;
|
|
}
|
|
}
|
|
|