• python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Facebook Twitter Instagram
Devs Fixed
  • python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Devs Fixed
Home ยป Resolved: Alpine Nginx install can’t find `upload_progress` directive despite it being compiled into the binary

Resolved: Alpine Nginx install can’t find `upload_progress` directive despite it being compiled into the binary

0
By Isaac Tonny on 17/06/2022 Issue
Share
Facebook Twitter LinkedIn

Question:

The Problem


I have a web-application that I want to containerize with docker and reverse-proxy via nginx. This web application shall receive uploads of audio files (~200-500Mb), thus I want upload progress events while uploading to be sent to the client.
I decided to base my docker image (see dockerfile below) on an alpine base that also contains glibc. From there the idea was to install nginx from the alpine repositories and use the nginx upload progress module to send the progress events. This module is compiled into the nginx module on alpine by default (See Alpine Repository)!
Thus, I created a simple nginx.conf file (see below) that just enables the upload_progress uploads 1m; directive in the http-block and made sure it gets copied into the container to /etc/nginx/nginx.conf.
I then started the container, installed nginx through apk and ran nginx -t. However, the conf file fails the test with this error message:

Troubleshooting so far


The error indicates that the binary does not have the upload progress module compiled in. However, this goes contrary to what is documented on the alpine repositories.
I also validated that the module is present in the binary by running a docker container with -i and executing nginx -V inside it to get a dump of all the modules and flags it was compiled with. It contains the necessary --add-dynamic-module=/home/buildozer/aports/main/nginx/src/nginx-upload-progress-module-0.9.2/ as expected (see nginx -V dump below).
The nginx.conf is not the issue. When I run the given nginx conf file locally where I have compiled the upload progress module into nginx, it runs fine.
So now I’m left confused, what am I doing wrong? Why can’t I use the upload_progress directive when the module exists in the nginx binary?

dockerfile


nginx.conf


nginx -V dump


Answer:

The error indicates that the binary does not have the upload progress module compiled in.


Yes, it isn’t. You compile it as a dynamic module using
configure script parameter, so you need to load it dynamically using the load_module directive:
at the top configuration level before you were able to use it (or compile it into nginx binary as a static module).

If you have better answer, please add a comment about this, thank you!

alpine docker file-upload nginx
Share. Facebook Twitter LinkedIn

Related Posts

Resolved: How can I write CSS selector(s) that apply to table rows for all td elements on that row after a td with a certain class?

01/04/2023

Resolved: How do I use SetWindowText with Unicode in Win32 using PowerShell?

01/04/2023

Resolved: Shopware 400 Status Error “This value is too long. It should have 255 character or less.” When I Try Updating Database Table

01/04/2023

Leave A Reply

© 2023 DEVSFIX.COM

Type above and press Enter to search. Press Esc to cancel.