Skip to content

Instantly share code, notes, and snippets.

@kiafaldorius
Last active December 16, 2015 04:48
Show Gist options
  • Save kiafaldorius/5379517 to your computer and use it in GitHub Desktop.
Save kiafaldorius/5379517 to your computer and use it in GitHub Desktop.
Multipart ACL seems to not work... I'm on "HA-Proxy version 1.4.18 2011/09/16" manually compiled on Mac OSX Snow Leopard
00000000:http.accept(0003)=0004 from [127.0.0.1:49647]
00000000:http.clireq[0004:ffff]: POST /upload.json HTTP/1.1
00000000:http.clihdr[0004:ffff]: Host: localhost:9090
00000000:http.clihdr[0004:ffff]: Connection: keep-alive
00000000:http.clihdr[0004:ffff]: Content-Length: 201199
00000000:http.clihdr[0004:ffff]: Cache-Control: max-age=0
00000000:http.clihdr[0004:ffff]: Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
00000000:http.clihdr[0004:ffff]: Origin: null
00000000:http.clihdr[0004:ffff]: User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.65 Safari/537.31
00000000:http.clihdr[0004:ffff]: Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryW77NGtHaHWUON4G7
00000000:http.clihdr[0004:ffff]: Accept-Encoding: gzip,deflate,sdch
00000000:http.clihdr[0004:ffff]: Accept-Language: en-US,en;q=0.8,es;q=0.6
00000000:http.clihdr[0004:ffff]: Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
00000000:www.srvrep[0004:0005]: HTTP/1.1 404 Not Found
00000000:www.srvhdr[0004:0005]: Content-Type: text/html;charset=utf-8
00000000:www.srvhdr[0004:0005]: X-Cascade: pass
00000000:www.srvhdr[0004:0005]: Content-Length: 8450
00000000:www.srvhdr[0004:0005]: Server: WEBrick/1.3.1 (Ruby/1.9.2/2011-07-09)
00000000:www.srvhdr[0004:0005]: Date: Sat, 13 Apr 2013 18:24:32 GMT
00000000:www.srvhdr[0004:0005]: Connection: close
defaults
timeout client 10s
timeout server 30s
timeout connect 15s
mode http
option http-server-close
frontend http
bind 0.0.0.0:9090
mode http
default_backend www
acl multipart hdr(Content-Type) -i multipart/form-data
use_backend uploads if multipart
backend www
balance roundrobin
server www0 localhost:4567 maxconn 24
backend uploads
balance roundrobin
server mult0 localhost:8080 maxconn 12
<html><head></head><body>
<form action="http://localhost:9090/upload.json" method="post" enctype="multipart/form-data">
<input type="file" name="file">
<input type="submit">
</form>
</body></html>
@kiafaldorius
Copy link
Author

Updated the config with something that works. Key parts to note is the "option http-server-close" and the -i part of the hdr.

Thanks to Willy Tarreau and Lukas Tribus!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment