<div dir="ltr">I'm working on an nginx module which will handle POST requests. I've never written an nginx module before, but I have worked on apache modules. My goal is to have it do unbuffered reads and process the data being posted as it arrives. Initially, I'm doing just a simple blocking read of the POST body. I've simplified things down almost to the "hello world" level.<div><br></div><div>When I do a POST, my module gets called, but I get a 404 not found, I am not sure why. I do see the file I post being uploaded and stored in a file in the nginx temporary file area. I do not see an entry in the access log showing the POST, again I am not sure why.  How can I fix these things?</div><div><br></div><div>Source to my module:</div><div><a href="https://github.com/benmesander/ngx-dashll-module/tree/main">https://github.com/benmesander/ngx-dashll-module/tree/main</a></div><div><br></div><div>Results of sending a POST request:</div><div><br></div><div>





<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">bmesander@o-bmesander-D093Y Downloads % curl -v -X POST -H "Content-Type: application/json" -d @chrome-net-export-log.json <a href="http://www:80/upload">http://www:80/upload</a></span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">Note: Unnecessary use of -X or --request, POST is already inferred.</span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">* <span class="gmail-Apple-converted-space">  </span>Trying x.x.x.x:80...</span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">* Connected to www (x.x.x.x) port 80 (#0)</span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">> POST /upload HTTP/1.1</span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">> Host: www</span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">> User-Agent: curl/7.86.0</span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">> Accept: */*</span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">> Content-Type: application/json</span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">> Content-Length: 777095</span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">><span class="gmail-Apple-converted-space"> </span></span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">* We are completely uploaded and fine</span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">* Mark bundle as not supporting multiuse</span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">< HTTP/1.1 404 Not Found</span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">< Server: nginx/1.25.3</span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">< Date: Mon, 18 Sep 2023 15:11:35 GMT</span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">< Content-Type: text/html</span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">< Content-Length: 153</span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">< Connection: keep-alive</span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><<span class="gmail-Apple-converted-space"> </span></span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><html></span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><head><title>404 Not Found</title></head></span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><body></span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><center><h1>404 Not Found</h1></center></span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><hr><center>nginx/1.25.3</center></span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"></body></span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"></html></span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">* Connection #0 to host www left intact</span></p></div><div><br></div><div>Here is how I am building nginx & my module:<br clear="all"><div>





<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-variant-alternates:normal;font-kerning:auto;font-feature-settings:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">auto/configure --with-debug </span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">--with-cc-opt=</span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(253,172,128)">"</span><span class="gmail-s1" style="color:rgb(253,172,128);font-variant-ligatures:no-common-ligatures">-fsanitize=address -DNGX_DEBUG_PALLOC=1"</span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures"> </span><span style="font-variant-ligatures:no-common-ligatures">--wit</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">h-ld-opt=</span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(253,172,128)">"</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(253,172,128)">-fsanitize=address" </span><span style="font-variant-ligatures:no-common-ligatures">--add-module=../</span>ngx-dashll-module</p>











</div><span class="gmail_signature_prefix"><div><span class="gmail_signature_prefix"><br></span></div><div><span class="gmail_signature_prefix">Thank you,</span></div><div><span class="gmail_signature_prefix">Ben</span></div><div><span class="gmail_signature_prefix"><br></span></div>-- </span><br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><p class="MsoNormal" style="color:rgb(34,34,34);background-image:initial;background-position:initial;background-repeat:initial;vertical-align:bottom"><b><span style="font-size:12pt;font-family:Arial,sans-serif;color:rgb(31,73,125)"></span></b><b><span style="font-size:16.5pt;font-family:Arial,sans-serif;color:rgb(31,73,125)">Ben Mesander       </span></b><b><span style="font-size:20pt;font-family:Arial,sans-serif;color:rgb(157,19,19)">C</span></b><b><span style="font-size:14pt;font-family:Arial,sans-serif;color:rgb(157,19,19)">ARDINAL</span></b><b><span style="font-size:20pt;font-family:Arial,sans-serif;color:rgb(118,113,113)">P</span></b><b><span style="font-size:14pt;font-family:Arial,sans-serif;color:rgb(118,113,113)">EAK</span></b><span style="font-size:12pt;font-family:Arial,sans-serif"></span></p><p class="MsoNormal" style="color:rgb(34,34,34);background-image:initial;background-position:initial;background-repeat:initial"><span style="font-size:12pt;font-family:Arial,sans-serif">(303) 570-1606  </span><span style="font-size:9pt;font-family:Arial,sans-serif;color:rgb(31,73,125)">|   </span><span style="font-size:12pt;font-family:Arial,sans-serif"><a href="mailto:bmesander@cardinalpeak.com" style="color:rgb(17,85,204)" target="_blank"><span style="font-size:9pt;color:rgb(162,30,34)">Email</span></a></span><span style="font-size:9pt;font-family:Arial,sans-serif;color:rgb(31,73,125)">  |  </span><span style="font-size:12pt;font-family:Arial,sans-serif"><a href="http://www.cardinalpeak.com/" style="color:rgb(17,85,204)" target="_blank"><span style="font-size:9pt;color:rgb(162,30,34)">Web</span></a></span><span style="font-size:9pt;font-family:Arial,sans-serif;color:rgb(31,73,125)"> |  </span><span style="font-size:12pt;font-family:Arial,sans-serif"><a href="http://www.cardinalpeak.com/blog" style="color:rgb(17,85,204)" target="_blank"><span style="font-size:9pt;color:rgb(162,30,34)">Company Blog</span></a></span><span style="font-size:9pt;font-family:Arial,sans-serif;color:rgb(31,73,125)">  |  </span><span style="font-size:12pt;font-family:Arial,sans-serif"><a href="https://www.linkedin.com/in/benmesander/" style="color:rgb(17,85,204)" target="_blank"><span style="font-size:9pt;color:rgb(162,30,34)">LinkedIn</span></a></span></p></div></div></div></div>