I followed the instructions from X-Sendfile emulation. I edited uwsgi.ini and changed the configuration to include the following:
[uwsgi]
...
; load router_static plugin (compiled in by default in monolithic profiles)
plugins = router_static
; spawn 2 offload threads
offload-threads = 2
; files under /private can be safely served
static-safe = [my_django_dir]/private
; collect the X-Sendfile response header as X_SENDFILE var
collect-header = X-Sendfile X_SENDFILE
; if X_SENDFILE is not empty, pass its value to the "static" routing action (it will automatically use offloading if available)
response-route-if-not = empty:${X_SENDFILE} static:${X_SENDFILE}
When I tried to start the server I got the following error message:
open("./router_static_plugin.so"): No such file or directory [core/utils.c line 3732]
!!! UNABLE to load uWSGI plugin: ./router_static_plugin.so: cannot open shared object file: No such file or directory !!!
I tried to solve this by specifying the plugins-dir.
[uwsgi]
...
plugins-dir = /usr/lib/uwsgi
...
I also tried some variations of the path.
/usr/lib64/uwsgi
/usr/lib/uwsgi/plugins
/usr/lib64/uwsgi/plugins
Unfortunately, this still did not fix my problem.
open("/usr/lib/uwsgi/router_static_plugin.so"): No such file or directory [core/utils.c line 3732]
open("./router_static_plugin.so"): No such file or directory [core/utils.c line 3732]
!!! UNABLE to load uWSGI plugin: ./router_static_plugin.so: cannot open shared object file: No such file or directory !!!
How can I fix this problem? Did I include the wrong plugins-dir or is the plugin simply not available?